Skip to content

Commit 5ea4d2a

Browse files
committed
Pass common compile options to the linker
1 parent 0ca085c commit 5ea4d2a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libc/cmake/modules/LLVMLibCTestRules.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ function(create_libc_unittest fq_target_name)
218218

219219
_get_common_test_compile_options(compile_options "${LIBC_UNITTEST_C_TEST}"
220220
"${LIBC_UNITTEST_FLAGS}")
221+
# TODO: Perhaps we should should we have a separate function for link options.
222+
set(link_options ${compile_options})
221223
list(APPEND compile_options ${LIBC_UNITTEST_COMPILE_OPTIONS})
222224

223225
if(SHOW_INTERMEDIATE_OBJECTS)
@@ -272,6 +274,7 @@ function(create_libc_unittest fq_target_name)
272274
target_include_directories(${fq_build_target_name} SYSTEM PRIVATE ${LIBC_INCLUDE_DIR})
273275
target_include_directories(${fq_build_target_name} PRIVATE ${LIBC_SOURCE_DIR})
274276
target_compile_options(${fq_build_target_name} PRIVATE ${compile_options})
277+
target_link_options(${fq_build_target_name} PRIVATE ${compile_options})
275278

276279
if(NOT LIBC_UNITTEST_CXX_STANDARD)
277280
set(LIBC_UNITTEST_CXX_STANDARD ${CMAKE_CXX_STANDARD})

0 commit comments

Comments
 (0)