Skip to content

Commit

Permalink
Weirdly CMAKE_C_STANDARD 99 isn't working on Jessie...
Browse files Browse the repository at this point in the history
  • Loading branch information
Kazade committed Aug 24, 2015
1 parent 04cd32b commit d0ec6fd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -11,6 +11,7 @@ IF (KAZMATH_BUILD_TESTS)
FIND_PACKAGE(PkgConfig REQUIRED)
ENDIF (KAZMATH_BUILD_TESTS)

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)
Expand Down

1 comment on commit d0ec6fd

@Cloudef
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It sadly needs CMake 3.1, with 3.0 you can use add_compile_options though, and before that add_definitions to set flags.

I also made useful .cmake here https://github.com/Cloudef/orbment/blob/master/CMake/GCCCompatibleCompilerOptions.cmake

Example of how to use here:
https://github.com/Cloudef/orbment/blob/master/CMakeLists.txt#L22-L32

The optimization flags can be enabled with -DCMAKE_BUILD_TYPE=Upstream for example.

Please sign in to comment.