Skip to content

Commit 36c36c1

Browse files
committed
[libc] use llvm_update_compile_flags to populate rtti/exception compilation flags
1 parent 630c736 commit 36c36c1

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

libc/benchmarks/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ function(add_libc_benchmark_unittest target_name)
2929
gtest
3030
${LIBC_BENCHMARKS_UNITTEST_DEPENDS}
3131
)
32+
llvm_update_compile_flags(${target_name})
3233

3334
add_custom_command(
3435
TARGET ${target_name}
@@ -58,6 +59,7 @@ target_link_libraries(libc-benchmark
5859
LLVMSupport
5960
Threads::Threads
6061
)
62+
llvm_update_compile_flags(libc-benchmark)
6163

6264
add_libc_benchmark_unittest(libc-benchmark-test
6365
SRCS LibcBenchmarkTest.cpp
@@ -82,6 +84,7 @@ target_link_libraries(libc-memory-benchmark
8284
PUBLIC
8385
libc-benchmark
8486
)
87+
llvm_update_compile_flags(libc-memory-benchmark)
8588

8689
add_libc_benchmark_unittest(libc-memory-benchmark-test
8790
SRCS LibcMemoryBenchmarkTest.cpp
@@ -96,6 +99,7 @@ add_library(json
9699
JSON.h
97100
)
98101
target_link_libraries(json PUBLIC libc-memory-benchmark)
102+
llvm_update_compile_flags(json)
99103

100104
add_libc_benchmark_unittest(json-test
101105
SRCS JSONTest.cpp

libc/benchmarks/automemcpy/lib/CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
add_library(automemcpy_codegen CodeGen.cpp)
22
target_link_libraries(automemcpy_codegen PUBLIC LLVMSupport)
3-
target_compile_options(automemcpy_codegen PUBLIC -fno-rtti)
43
target_include_directories(automemcpy_codegen PUBLIC ${LIBC_AUTOMEMCPY_INCLUDE_DIR})
4+
llvm_update_compile_flags(automemcpy_codegen)
55

66
add_executable(automemcpy_codegen_main CodeGenMain.cpp RandomFunctionGenerator.cpp)
77
target_link_libraries(automemcpy_codegen_main PUBLIC automemcpy_codegen ${Z3_LIBRARIES})
8-
target_compile_options(automemcpy_codegen_main PUBLIC -fno-rtti)
8+
llvm_update_compile_flags(automemcpy_codegen_main)
99

1010
set(Implementations "${CMAKE_CURRENT_BINARY_DIR}/Implementations.cpp")
1111
add_custom_command(
@@ -19,14 +19,18 @@ add_custom_command(
1919
add_library(automemcpy_implementations "${Implementations}")
2020
target_link_libraries(automemcpy_implementations PUBLIC LLVMSupport libc-memory-benchmark)
2121
target_include_directories(automemcpy_implementations PRIVATE ${LIBC_SOURCE_DIR} ${LIBC_AUTOMEMCPY_INCLUDE_DIR})
22-
target_compile_options(automemcpy_implementations PUBLIC -fno-rtti PRIVATE ${LIBC_COMPILE_OPTIONS_NATIVE} "SHELL:-mllvm -combiner-global-alias-analysis" -fno-builtin)
22+
target_compile_options(automemcpy_implementations PRIVATE ${LIBC_COMPILE_OPTIONS_NATIVE} "SHELL:-mllvm -combiner-global-alias-analysis" -fno-builtin)
23+
llvm_update_compile_flags(automemcpy_implementations)
2324

2425
add_executable(automemcpy EXCLUDE_FROM_ALL ${LIBC_SOURCE_DIR}/benchmarks/LibcMemoryGoogleBenchmarkMain.cpp)
2526
target_link_libraries(automemcpy PRIVATE libc-memory-benchmark benchmark_main automemcpy_implementations)
27+
llvm_update_compile_flags(automemcpy)
2628

2729
add_library(automemcpy_result_analyzer_lib EXCLUDE_FROM_ALL ResultAnalyzer.cpp)
2830
target_link_libraries(automemcpy_result_analyzer_lib PUBLIC LLVMSupport)
2931
target_include_directories(automemcpy_result_analyzer_lib PUBLIC ${LIBC_AUTOMEMCPY_INCLUDE_DIR})
32+
llvm_update_compile_flags(automemcpy_result_analyzer_lib)
3033

3134
add_executable(automemcpy_result_analyzer EXCLUDE_FROM_ALL ResultAnalyzerMain.cpp)
3235
target_link_libraries(automemcpy_result_analyzer PRIVATE automemcpy_result_analyzer_lib automemcpy_implementations)
36+
llvm_update_compile_flags(automemcpy_result_analyzer)

0 commit comments

Comments
 (0)