Skip to content

Commit 3aa236a

Browse files
committed
Properly add the compile definitions coming from ROOT.
That will help us when creating C libraries.
1 parent 3fb22a8 commit 3aa236a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,14 @@ include(PytestBenchmark)
5454

5555
#---Add ROOT include direcories and used compilation flags
5656
include_directories(${ROOT_INCLUDE_DIRS})
57-
add_definitions(${ROOT_CXX_FLAGS})
57+
string(REPLACE " " ";" ROOT_C_FLAGS_LIST ${ROOT_C_FLAGS})
58+
string(REPLACE " " ";" ROOT_CXX_FLAGS_LIST ${ROOT_CXX_FLAGS})
59+
foreach(C_COMPILE_FLAG ${ROOT_C_FLAGS_LIST})
60+
add_compile_options($<$<COMPILE_LANGUAGE:C>:${C_COMPILE_FLAG}>)
61+
endforeach()
62+
foreach(CXX_COMPILE_FLAG ${ROOT_CXX_FLAGS_LIST})
63+
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:${CXX_COMPILE_FLAG}>)
64+
endforeach()
5865

5966
#---Include rootbench options
6067
include(RootBenchOptions)

0 commit comments

Comments
 (0)