From 11d0a509f4f16fa4b5a99dc988a37ba60de43e57 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Thu, 5 Jan 2023 00:16:26 +0700 Subject: [PATCH 3/3] tests/CMakeLists.txt: use C++17 --- tests/CMakeLists.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b788444..45ba1ba 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -10,8 +10,23 @@ add_executable(${PROJECT_NAME} variant_test.cpp ) -if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU|Clang") +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") + target_compile_options(${PROJECT_NAME} + PRIVATE + -std=gnu++17 + ) +else() target_compile_options(${PROJECT_NAME} + PRIVATE + -std=c++17 + ) +endif() + +if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + add_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Werror -ansi -pedantic ) -- 2.39.0