Skip to content

Commit

Permalink
[cmake] Set C standard to C99 without GNU extensions for whole project
Browse files Browse the repository at this point in the history
Does not overwrite setting by user, if variables are set.
  • Loading branch information
gruenich committed May 7, 2023
1 parent 40ec9a5 commit 74c563a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ include(FeatureSummary)
#
######################################################################

# set C standard to C99 without GNU extensions, if not specified by the user
if ("${CMAKE_C_STANDARD}" STREQUAL "")
set(CMAKE_C_STANDARD 99)
endif()
if ("${CMAKE_C_EXTENSIONS}" STREQUAL "")
set(CMAKE_C_EXTENSIONS FALSE)
endif()

#---- set RPATH handling
# use, i.e. don't skip the full RPATH for the build tree
set(CMAKE_SKIP_BUILD_RPATH FALSE)
Expand Down

0 comments on commit 74c563a

Please sign in to comment.