Skip to content

Commit f72e1a2

Browse files
authored
Avoid recompiling fpu.cxx a gazillion of times (#14686)
This will simply link the object file from fpu.cxx, which will be compiled only once.
1 parent e019d1a commit f72e1a2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Common/Utils/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,6 @@ o2_add_executable(treemergertool
9191
COMPONENT_NAME CommonUtils
9292
SOURCES src/TreeMergerTool.cxx
9393
PUBLIC_LINK_LIBRARIES O2::CommonUtils Boost::program_options ROOT::Core)
94+
95+
add_library(fpu_support OBJECT src/fpu.cxx)
96+
add_library(O2::fpu_support ALIAS fpu_support)

cmake/O2AddExecutable.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function(o2_add_executable baseTargetName)
9292
endif()
9393

9494
# add the executable with its sources
95-
add_executable(${target} ${A_SOURCES} ${CMAKE_SOURCE_DIR}/Common/Utils/src/fpu.cxx)
95+
add_executable(${target} ${A_SOURCES})
9696

9797
# set the executable output name
9898
set_property(TARGET ${target} PROPERTY OUTPUT_NAME ${exeName})
@@ -118,6 +118,7 @@ function(o2_add_executable baseTargetName)
118118

119119
# needed for fpu.c
120120
target_link_libraries(${target} PUBLIC ROOT::XMLIO)
121+
target_link_libraries(${target} PUBLIC O2::fpu_support)
121122

122123
if(NOT A_NO_INSTALL)
123124
# install the executable

0 commit comments

Comments
 (0)