Skip to content

Commit

Permalink
[CMake] Do not set CMAKE_CXX_EXTENSIONS if already defined
Browse files Browse the repository at this point in the history
  • Loading branch information
tttapa committed Feb 11, 2024
1 parent dec8b78 commit 8d63f70
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 8d63f70

Please sign in to comment.