From 8d63f70b7a2c30242b059534042c1b00a548f770 Mon Sep 17 00:00:00 2001 From: Pieter Pas Date: Sun, 11 Feb 2024 14:44:08 +0100 Subject: [PATCH] [CMake] Do not set CMAKE_CXX_EXTENSIONS if already defined --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16e97f835f..a19249bee0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,8 +107,12 @@ add_warnings_target(warnings ${ALPAQA_WARNINGS_AS_ERRORS}) add_library(alpaqa::warnings ALIAS warnings) # Compiler options -set(CMAKE_CXX_EXTENSIONS ${ALPAQA_WITH_QUAD_PRECISION}) -set(CMAKE_C_EXTENSIONS ${ALPAQA_WITH_QUAD_PRECISION}) +if (NOT DEFINED CMAKE_CXX_EXTENSIONS) + set(CMAKE_CXX_EXTENSIONS ${ALPAQA_WITH_QUAD_PRECISION}) +endif() +if (NOT DEFINED CMAKE_C_EXTENSIONS) + set(CMAKE_C_EXTENSIONS ${ALPAQA_WITH_QUAD_PRECISION}) +endif() if (ALPAQA_WITH_PYTHON OR ALPAQA_WITH_MATLAB) set(CMAKE_POSITION_INDEPENDENT_CODE On) endif()