From: Mathieu Malaterre Date: Tue, 17 Jan 2023 11:23:31 +0000 (+0000) Subject: missing atomic support for hwy_test X-Git-Tag: archive/raspbian/1.0.3-2+rpi1~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=064c1ae1c2440252ecc8dd3f9c8a42ea87d1a76a;p=highway.git missing atomic support for hwy_test Last-Update: 2022-11-03 Gbp-Pq: Name hwy_test_atomic.patch --- diff --git a/CMakeLists.txt b/CMakeLists.txt index b6b14ab..b26dd54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -294,8 +294,8 @@ set_target_properties(hwy PROPERTIES LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/hwy/hwy.version) # For GCC __atomic_store_8, see #887 target_link_libraries(hwy PRIVATE ${ATOMICS_LIBRARIES}) +# not supported by MSVC/Clang, safe to skip (we use DLLEXPORT annotations) if(UNIX AND NOT APPLE) - # not supported by MSVC/Clang, safe to skip (we use DLLEXPORT annotations) set_property(TARGET hwy APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/hwy/hwy.version") endif() @@ -335,7 +335,7 @@ endif() endif() # HWY_ENABLE_CONTRIB add_library(hwy_test ${HWY_LIBRARY_TYPE} ${HWY_TEST_SOURCES}) -target_link_libraries(hwy_test hwy) +target_link_libraries(hwy_test PRIVATE hwy) target_compile_options(hwy_test PRIVATE ${HWY_FLAGS}) set_property(TARGET hwy_test PROPERTY POSITION_INDEPENDENT_CODE ON) set_target_properties(hwy_test PROPERTIES VERSION ${LIBRARY_VERSION} SOVERSION ${LIBRARY_SOVERSION}) @@ -345,6 +345,8 @@ target_include_directories(hwy_test PUBLIC target_compile_features(hwy_test PUBLIC cxx_std_11) set_target_properties(hwy_test PROPERTIES LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/hwy/hwy.version) +# For GCC __atomic_store_8, see #887 +target_link_libraries(hwy_test PRIVATE ${ATOMICS_LIBRARIES}) # not supported by MSVC/Clang, safe to skip (we use DLLEXPORT annotations) if(UNIX AND NOT APPLE) set_property(TARGET hwy_test APPEND_STRING PROPERTY @@ -559,7 +561,8 @@ foreach (TESTFILE IN LISTS HWY_TEST_FILES) # that include us may set them. target_compile_options(${TESTNAME} PRIVATE -DHWY_IS_TEST=1) - target_link_libraries(${TESTNAME} ${HWY_TEST_LIBS} ${HWY_GTEST_LIBS}) + target_link_libraries(${TESTNAME} PRIVATE ${HWY_TEST_LIBS} ${HWY_GTEST_LIBS}) + target_link_libraries(${TESTNAME} PRIVATE ${ATOMICS_LIBRARIES}) # Output test targets in the test directory. set_target_properties(${TESTNAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "tests")