diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index ca209e65057..567fdddd634 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -35,7 +35,6 @@ function(ginkgo_benchmark_onemkl_linops type def) add_library(onemkl_linops_${type} utils/dpcpp_linops.dp.cpp) # make the dependency public to catch issues target_compile_definitions(onemkl_linops_${type} PUBLIC ${def}) - target_compile_features(onemkl_linops_${type} PRIVATE cxx_std_17) target_link_libraries(onemkl_linops_${type} PRIVATE Ginkgo::ginkgo MKL::MKL_DPCPP) endfunction() diff --git a/cmake/create_test.cmake b/cmake/create_test.cmake index e9c8131436c..20bc9ad9698 100644 --- a/cmake/create_test.cmake +++ b/cmake/create_test.cmake @@ -32,7 +32,6 @@ function(ginkgo_set_test_target_properties test_target_name test_library_suffix) else() target_link_libraries(${test_target_name} PRIVATE ginkgo_gtest_main${test_library_suffix}) endif() - target_compile_features(${test_target_name} PUBLIC cxx_std_14) # we set these properties regardless of the enabled backends, # because unknown properties are ignored set_target_properties(${test_target_name} PROPERTIES HIP_STANDARD 17) @@ -129,7 +128,6 @@ endfunction(ginkgo_create_test) function(ginkgo_create_dpcpp_test test_name) ginkgo_build_test_name(${test_name} test_target_name) add_executable(${test_target_name} ${test_name}.dp.cpp) - target_compile_features(${test_target_name} PUBLIC cxx_std_17) target_compile_options(${test_target_name} PRIVATE ${GINKGO_DPCPP_FLAGS}) gko_add_sycl_to_target(TARGET ${test_target_name} SOURCES ${test_name}.dp.cpp) target_link_options(${test_target_name} PRIVATE -fsycl-device-code-split=per_kernel) @@ -260,7 +258,6 @@ function(ginkgo_create_common_device_test test_name) ginkgo_build_test_name(${test_name} test_target_name) if(GINKGO_BUILD_SYCL) ginkgo_create_common_test_internal(${test_name} DpcppExecutor dpcpp ${ARGN}) - target_compile_features(${test_target_name}_dpcpp PRIVATE cxx_std_17) target_compile_options(${test_target_name}_dpcpp PRIVATE ${GINKGO_DPCPP_FLAGS}) # We need to use a new file to avoid sycl setting in other backends because add_sycl_to_target will change the source property. configure_file(${test_name}.cpp ${test_name}.dp.cpp COPYONLY) diff --git a/dpcpp/CMakeLists.txt b/dpcpp/CMakeLists.txt index 492e6fe3edd..3ce52b704fd 100644 --- a/dpcpp/CMakeLists.txt +++ b/dpcpp/CMakeLists.txt @@ -101,7 +101,6 @@ gko_add_sycl_to_target(TARGET ginkgo_dpcpp) # Note: add MKL as PRIVATE not PUBLIC (MKL example shows) to avoid propagating # find_package(MKL) everywhere when linking ginkgo (see the MKL example # https://software.intel.com/content/www/us/en/develop/documentation/onemkl-windows-developer-guide/top/getting-started/cmake-config-for-onemkl.html) -target_compile_features(ginkgo_dpcpp PUBLIC cxx_std_17) target_link_options(ginkgo_dpcpp PRIVATE -fsycl-device-lib=all) # When building ginkgo as a static library, we need to use dpcpp and per_kernel # link option when the program uses a dpcpp related function. diff --git a/test/test_exportbuild/CMakeLists.txt b/test/test_exportbuild/CMakeLists.txt index c65f964d9a0..cb8f0b1225c 100644 --- a/test/test_exportbuild/CMakeLists.txt +++ b/test/test_exportbuild/CMakeLists.txt @@ -7,5 +7,4 @@ find_package(Ginkgo REQUIRED # Here, we use test install without any data. We instantiate the # interface only. add_executable(test_exportbuild ../test_install/test_install.cpp) -target_compile_features(test_exportbuild PUBLIC cxx_std_14) target_link_libraries(test_exportbuild PRIVATE Ginkgo::ginkgo) diff --git a/test/test_install/CMakeLists.txt b/test/test_install/CMakeLists.txt index 60fad7cf339..285c21f271b 100644 --- a/test/test_install/CMakeLists.txt +++ b/test/test_install/CMakeLists.txt @@ -26,7 +26,6 @@ if (GINKGO_BUILD_REFERENCE) set(HAS_REFERENCE 1) endif() add_executable(test_install test_install.cpp) -target_compile_features(test_install PUBLIC cxx_std_14) target_compile_definitions(test_install PRIVATE HAS_REFERENCE=${HAS_REFERENCE}) target_link_libraries(test_install PRIVATE Ginkgo::ginkgo) if(GINKGO_BUILD_MPI) diff --git a/test/test_pkgconfig/CMakeLists.txt b/test/test_pkgconfig/CMakeLists.txt index e904f997f26..12b9fc4dc26 100644 --- a/test/test_pkgconfig/CMakeLists.txt +++ b/test/test_pkgconfig/CMakeLists.txt @@ -8,7 +8,7 @@ pkg_check_modules(GINKGO REQUIRED IMPORTED_TARGET ginkgo) # Here, we use test install without any data. We instantiate the # interface only. add_executable(test_pkgconfig ../test_install/test_install.cpp) -target_compile_features(test_pkgconfig PUBLIC cxx_std_14) +target_compile_features(test_pkgconfig PUBLIC cxx_std_17) # CMake PkgConfig only puts the -l, -L, and -framework into link_libraries and others into link_options # When linking the target, the linking option will be before the compiled object to lead the linking error set_property(TARGET PkgConfig::GINKGO PROPERTY INTERFACE_LINK_LIBRARIES "${GINKGO_LDFLAGS}") diff --git a/test/test_subdir/CMakeLists.txt b/test/test_subdir/CMakeLists.txt index dcf846f4adc..00ae3bc07e2 100644 --- a/test/test_subdir/CMakeLists.txt +++ b/test/test_subdir/CMakeLists.txt @@ -5,5 +5,4 @@ file(CREATE_LINK "${CMAKE_CURRENT_SOURCE_DIR}/../.." "${CMAKE_CURRENT_BINARY_DIR add_subdirectory("${CMAKE_CURRENT_BINARY_DIR}/ginkgo") add_executable(test_subdir ../test_install/test_install.cpp) -target_compile_features(test_subdir PUBLIC cxx_std_14) target_link_libraries(test_subdir PRIVATE Ginkgo::ginkgo)