From 4544c05f64fedad4c4266c61ba59b6268293ac3e Mon Sep 17 00:00:00 2001 From: yuejiaointel Date: Wed, 23 Jul 2025 17:03:24 -0700 Subject: [PATCH 1/6] fix: add conitiona in shared test for testing --- examples/cpp/shared/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/cpp/shared/CMakeLists.txt b/examples/cpp/shared/CMakeLists.txt index 3155c4f22..e658e79bd 100644 --- a/examples/cpp/shared/CMakeLists.txt +++ b/examples/cpp/shared/CMakeLists.txt @@ -38,3 +38,8 @@ SET(CMAKE_CXX_FLAGS "-O3 -DNDEBUG -std=gnu++20 -march=native -mtune=native -Wer add_executable(shared shared.cpp) target_link_libraries(shared PUBLIC ${SVS_SHARED} svs::svs) +# Testing without native flag for different archs +if(SVS_TEST_EXAMPLES) + set(CMAKE_CXX_FLAGS "-O3 -DNDEBUG -std=gnu++20 -Werror -Wall -Wextra -Wpedantic") + target_link_libraries(shared PUBLIC ${SVS_SHARED} svs::svs svs::svs_x86_options_base) +endif() \ No newline at end of file From 36fa9efbd28de3b3ca57f44f4ab177d328874ada Mon Sep 17 00:00:00 2001 From: yuejiaointel Date: Wed, 23 Jul 2025 17:50:38 -0700 Subject: [PATCH 2/6] fix: remove 86 options base --- examples/cpp/shared/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/cpp/shared/CMakeLists.txt b/examples/cpp/shared/CMakeLists.txt index e658e79bd..de49d0c5b 100644 --- a/examples/cpp/shared/CMakeLists.txt +++ b/examples/cpp/shared/CMakeLists.txt @@ -41,5 +41,4 @@ target_link_libraries(shared PUBLIC ${SVS_SHARED} svs::svs) # Testing without native flag for different archs if(SVS_TEST_EXAMPLES) set(CMAKE_CXX_FLAGS "-O3 -DNDEBUG -std=gnu++20 -Werror -Wall -Wextra -Wpedantic") - target_link_libraries(shared PUBLIC ${SVS_SHARED} svs::svs svs::svs_x86_options_base) endif() \ No newline at end of file From f1cc0705583722340b8dab88653aea45e4068bb7 Mon Sep 17 00:00:00 2001 From: yuejiaointel Date: Wed, 23 Jul 2025 19:33:53 -0700 Subject: [PATCH 3/6] fix: fix spd log error --- examples/cpp/shared/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/cpp/shared/CMakeLists.txt b/examples/cpp/shared/CMakeLists.txt index de49d0c5b..60035c5b9 100644 --- a/examples/cpp/shared/CMakeLists.txt +++ b/examples/cpp/shared/CMakeLists.txt @@ -40,5 +40,8 @@ target_link_libraries(shared PUBLIC ${SVS_SHARED} svs::svs) # Testing without native flag for different archs if(SVS_TEST_EXAMPLES) + find_package(fmt REQUIRED) + find_package(spdlog REQUIRED) + target_link_libraries(shared PUBLIC ${SVS_SHARED} svs::svs fmt::fmt spdlog::spdlog) set(CMAKE_CXX_FLAGS "-O3 -DNDEBUG -std=gnu++20 -Werror -Wall -Wextra -Wpedantic") endif() \ No newline at end of file From 469ae4b437e610507ccbd9ba9de714bbc40531ad Mon Sep 17 00:00:00 2001 From: yuejiaointel Date: Wed, 23 Jul 2025 21:51:57 -0700 Subject: [PATCH 4/6] fix: add svs_x86_options_base --- examples/cpp/shared/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/cpp/shared/CMakeLists.txt b/examples/cpp/shared/CMakeLists.txt index 60035c5b9..7cad597fe 100644 --- a/examples/cpp/shared/CMakeLists.txt +++ b/examples/cpp/shared/CMakeLists.txt @@ -40,8 +40,6 @@ target_link_libraries(shared PUBLIC ${SVS_SHARED} svs::svs) # Testing without native flag for different archs if(SVS_TEST_EXAMPLES) - find_package(fmt REQUIRED) - find_package(spdlog REQUIRED) - target_link_libraries(shared PUBLIC ${SVS_SHARED} svs::svs fmt::fmt spdlog::spdlog) set(CMAKE_CXX_FLAGS "-O3 -DNDEBUG -std=gnu++20 -Werror -Wall -Wextra -Wpedantic") + target_link_libraries(shared PUBLIC ${SVS_SHARED} svs::svs svs_x86_options_base) endif() \ No newline at end of file From 2da5ec7a507cd671d1236ea028460590b7760599 Mon Sep 17 00:00:00 2001 From: yuejiaointel Date: Wed, 23 Jul 2025 23:24:16 -0700 Subject: [PATCH 5/6] fix: disable svs finding conditionly --- examples/cpp/shared/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/cpp/shared/CMakeLists.txt b/examples/cpp/shared/CMakeLists.txt index 7cad597fe..48585fc15 100644 --- a/examples/cpp/shared/CMakeLists.txt +++ b/examples/cpp/shared/CMakeLists.txt @@ -29,7 +29,12 @@ FetchContent_Declare( FetchContent_MakeAvailable(svs) list(APPEND CMAKE_PREFIX_PATH "${svs_SOURCE_DIR}") -find_package(svs REQUIRED) + +# No need when test from private +if(NOT SVS_TEST_PUBLIC_EXAMPLES) + find_package(svs REQUIRED) +endif() + find_library(SVS_SHARED svs_shared_library) set(SVS_CXX_STANDARD 20) @@ -39,7 +44,7 @@ add_executable(shared shared.cpp) target_link_libraries(shared PUBLIC ${SVS_SHARED} svs::svs) # Testing without native flag for different archs -if(SVS_TEST_EXAMPLES) +if(SVS_TEST_PUBLIC_EXAMPLES) set(CMAKE_CXX_FLAGS "-O3 -DNDEBUG -std=gnu++20 -Werror -Wall -Wextra -Wpedantic") target_link_libraries(shared PUBLIC ${SVS_SHARED} svs::svs svs_x86_options_base) endif() \ No newline at end of file From c734f5e2b1fe4ab98fd4ea316e5b68541251df93 Mon Sep 17 00:00:00 2001 From: yuejiaointel Date: Thu, 24 Jul 2025 11:10:07 -0700 Subject: [PATCH 6/6] fix: revert to orig --- examples/cpp/shared/CMakeLists.txt | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/examples/cpp/shared/CMakeLists.txt b/examples/cpp/shared/CMakeLists.txt index 48585fc15..3a8160040 100644 --- a/examples/cpp/shared/CMakeLists.txt +++ b/examples/cpp/shared/CMakeLists.txt @@ -29,12 +29,7 @@ FetchContent_Declare( FetchContent_MakeAvailable(svs) list(APPEND CMAKE_PREFIX_PATH "${svs_SOURCE_DIR}") - -# No need when test from private -if(NOT SVS_TEST_PUBLIC_EXAMPLES) - find_package(svs REQUIRED) -endif() - +find_package(svs REQUIRED) find_library(SVS_SHARED svs_shared_library) set(SVS_CXX_STANDARD 20) @@ -42,9 +37,3 @@ SET(CMAKE_CXX_FLAGS "-O3 -DNDEBUG -std=gnu++20 -march=native -mtune=native -Wer add_executable(shared shared.cpp) target_link_libraries(shared PUBLIC ${SVS_SHARED} svs::svs) - -# Testing without native flag for different archs -if(SVS_TEST_PUBLIC_EXAMPLES) - set(CMAKE_CXX_FLAGS "-O3 -DNDEBUG -std=gnu++20 -Werror -Wall -Wextra -Wpedantic") - target_link_libraries(shared PUBLIC ${SVS_SHARED} svs::svs svs_x86_options_base) -endif() \ No newline at end of file