From 696f5299f02f76dee42fc796b94bb0ec3b63c941 Mon Sep 17 00:00:00 2001 From: Olivier Le Doeuff Date: Mon, 26 Sep 2022 11:39:13 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Don't=20write=20to=20global=20CM?= =?UTF-8?q?AKE=5FCXX=5FSTANDARD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead use modern target_compile_features with cxx_std_11 --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f3ab1be..c5dff77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 3.9) project(fast_float VERSION 3.4.0 LANGUAGES CXX) option(FASTFLOAT_TEST "Enable tests" OFF) -set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ standard to be used") -set(CMAKE_CXX_STANDARD_REQUIRED ON) if(FASTFLOAT_TEST) enable_testing() add_subdirectory(tests) @@ -30,6 +28,7 @@ target_include_directories( $ $ ) +target_compile_features(fast_float INTERFACE cxx_std_11) if(FASTFLOAT_SANITIZE) target_compile_options(fast_float INTERFACE -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=all) target_link_libraries(fast_float INTERFACE -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=all)