Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for full LTO build #798

Merged
merged 2 commits into from
Mar 5, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ function(tbb_add_test)
${TBB_COMMON_COMPILE_FLAGS}
)

if (UNIX)
target_link_libraries(${_tbb_test_TARGET_NAME} PRIVATE -rdynamic) # for the test_dynamic_link
AlexVeprev marked this conversation as resolved.
Show resolved Hide resolved
endif()
if (ANDROID_PLATFORM)
# Expand the linker rpath by the CMAKE_LIBRARY_OUTPUT_DIRECTORY path since clang compiler from Android SDK
# doesn't respect the -L flag.
target_link_libraries(${_tbb_test_TARGET_NAME} PRIVATE "-Wl,--rpath-link,${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
target_link_libraries(${_tbb_test_TARGET_NAME} PRIVATE -rdynamic) # for the test_dynamic_link
add_test(NAME ${_tbb_test_TARGET_NAME}
COMMAND ${CMAKE_COMMAND}
-DBINARIES_PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
Expand Down Expand Up @@ -93,8 +95,10 @@ function(tbb_add_c_test)
add_executable(${_tbb_test_NAME} ${_tbb_test_SUBDIR}/${_tbb_test_NAME}.c)
target_include_directories(${_tbb_test_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR})

if (ANDROID_PLATFORM)
if (UNIX)
target_link_libraries(${_tbb_test_NAME} PRIVATE -rdynamic) # for the test_dynamic_link
endif()
if (ANDROID_PLATFORM)
add_test(NAME ${_tbb_test_NAME}
COMMAND ${CMAKE_COMMAND}
-DBINARIES_PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
Expand Down Expand Up @@ -574,8 +578,10 @@ if (TARGET TBB::tbbmalloc)
${TBB_COMMON_COMPILE_FLAGS}
${TBBMALLOC_LIB_COMPILE_FLAGS}
)
if (ANDROID_PLATFORM)
if (UNIX)
target_link_libraries(test_malloc_whitebox PRIVATE -rdynamic) # for the test_dynamic_link
endif()
if (ANDROID_PLATFORM)
add_test(NAME test_malloc_whitebox
COMMAND ${CMAKE_COMMAND}
-DBINARIES_PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
Expand Down