1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

don't build if compiler cannot do -std=c++20 or -std=c++2a

using invalid option messes up following CHECK_xxx tests
and they are cached and affect the build even if columnstore
itself is disabled.
This commit is contained in:
Sergei Golubchik
2022-08-30 21:39:17 +02:00
parent 23c01c1cbb
commit 96eb95cb00

View File

@ -32,7 +32,13 @@ MY_CHECK_CXX_COMPILER_FLAG("-std=c++20")
IF (have_CXX__std_c__20)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20")
ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++2a")
MY_CHECK_CXX_COMPILER_FLAG("-std=c++2a")
IF (have_CXX__std_c__2a)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++2a")
ELSE()
MESSAGE_ONCE(CS_NO_CXX20 "C++ Compiler does not understand -std=c++20")
return()
ENDIF()
ENDIF()
UNSET(CMAKE_CXX_STANDARD)