@@ -33,27 +33,27 @@ string(TOUPPER "${CMAKE_BUILD_TYPE}" U_CMAKE_BUILD_TYPE)
3333
3434include (set_compiler_flag.cmake)
3535
36- if (CPP17 )
37- # User requested C++17 , but compiler might not oblige.
36+ if (CPP20 )
37+ # User requested C++20 , but compiler might not oblige.
3838 set_compiler_flag(
3939 _cxx_std_flag CXX
40- "-std=c++17 " # this should work with GNU, Intel, PGI
41- "/std:c++17 " # this should work with MSVC
40+ "-std=c++20 " # this should work with GNU, Intel, PGI
41+ "/std:c++20 " # this should work with MSVC
4242 )
4343 if (_cxx_std_flag)
44- message (STATUS "Building with C++17 " )
44+ message (STATUS "Building with C++20 " )
4545 endif ()
4646else ()
4747 set_compiler_flag(
4848 _cxx_std_flag CXX REQUIRED
49- "-std=c++14 " # this should work with GNU, Intel, PGI
50- "/std:c++14 " # this should work with MSVC
49+ "-std=c++17 " # this should work with GNU, Intel, PGI
50+ "/std:c++17 " # this should work with MSVC
5151 )
52- message (STATUS "Building with C++14 " )
52+ message (STATUS "Building with C++17 " )
5353endif ()
5454
5555if (NOT _cxx_std_flag)
56- message (FATAL_ERROR "xtensor-blas needs a C++14 -compliant compiler." )
56+ message (FATAL_ERROR "xtensor-blas needs a C++17 -compliant compiler." )
5757endif ()
5858
5959if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR (CMAKE_CXX_COMPILER_ID MATCHES "Intel" AND NOT WIN32 ))
@@ -115,10 +115,7 @@ if(DOWNLOAD_GTEST OR GTEST_SRC_DIR)
115115 ${CMAKE_CURRENT_BINARY_DIR} /googletest-build EXCLUDE_FROM_ALL )
116116
117117 set (GTEST_INCLUDE_DIRS "${gtest_SOURCE_DIR} /include" )
118- add_library (GTest::GTest INTERFACE IMPORTED )
119- target_link_libraries (GTest::GTest INTERFACE gtest)
120- add_library (GTest::Main INTERFACE IMPORTED )
121- target_link_libraries (GTest::Main INTERFACE gtest_main)
118+ set (GTEST_BOTH_LIBRARIES gtest_main gtest)
122119else ()
123120 find_package (GTest REQUIRED)
124121endif ()
@@ -161,7 +158,7 @@ if(DOWNLOAD_GTEST OR GTEST_SRC_DIR)
161158 add_dependencies (test_xtensor_blas gtest_main)
162159endif ()
163160
164- target_link_libraries (test_xtensor_blas ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} GTest::GTest GTest::Main ${CMAKE_THREAD_LIBS_INIT} )
161+ target_link_libraries (test_xtensor_blas ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} )
165162
166163add_custom_target (xtest COMMAND test_xtensor_blas DEPENDS test_xtensor_blas)
167164add_test (NAME xtest COMMAND test_xtensor_blas)
0 commit comments