mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
CMake: Explicitly ask for C99 support
Otherwise using a compiler that defaults to -std=c89 or -std=gnu89 will fail. Example: http://www.cpantesters.org/cpan/report/abb85066-d283-11e7-9926-b2f4efb9c382 Apparently, -m32 Travis CI build was broken: -m32 was overridden by -std=gnu99. This fixes that.
This commit is contained in:
@ -4,6 +4,14 @@ cmake_minimum_required(VERSION 3.0)
|
||||
set(BUILD_EXAMPLES ON CACHE BOOL "Build the examples.")
|
||||
set(BUILD_GAMES ON CACHE BOOL "Build the example games.")
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS "3.1")
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
set(CMAKE_C_FLAGS "-std=gnu99 ${CMAKE_C_FLAGS}")
|
||||
endif()
|
||||
else()
|
||||
set (CMAKE_C_STANDARD 99)
|
||||
endif()
|
||||
|
||||
add_subdirectory(src release)
|
||||
|
||||
if (${BUILD_EXAMPLES})
|
||||
|
||||
Reference in New Issue
Block a user