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()