1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 01:59:43 +01:00

Up the standard to C99

The previous commit f6d7a214f8 ended up
breaking CI because the workaround ended up breaking the PhysFS build
too, which was previously relying on extensions to compile.

Since #869 is going to require C99 anyways, I might as well just up the
standard now. That way the PR won't have to fight it too.
This commit is contained in:
Misa 2022-03-21 20:27:15 -07:00
parent f6d7a214f8
commit 705864a32a

View file

@ -28,16 +28,16 @@ if(${CMAKE_VERSION} VERSION_LESS "3.1.3")
message(WARNING "Your CMake version is too old; using workaround") message(WARNING "Your CMake version is too old; using workaround")
if(MSVC) if(MSVC)
# MSVC doesn't have /std:c90 or /std:c++98 switches! # MSVC doesn't have /std:c99 or /std:c++98 switches!
else() else()
string(REGEX REPLACE "-std=[a-z0-9]+" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") string(REGEX REPLACE "-std=[a-z0-9]+" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c90") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
string(REGEX REPLACE "-std=[a-z0-9+]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") string(REGEX REPLACE "-std=[a-z0-9+]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
endif() endif()
else() else()
set(CMAKE_C_STANDARD 90) set(CMAKE_C_STANDARD 99)
set(CMAKE_C_EXTENSIONS OFF) set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 98) set(CMAKE_CXX_STANDARD 98)
@ -302,12 +302,6 @@ if(BUNDLE_DEPENDENCIES)
-DPHYSFS_SUPPORTS_DEFAULT=0 -DPHYSFS_SUPPORTS_ZIP=1 -DPHYSFS_SUPPORTS_DEFAULT=0 -DPHYSFS_SUPPORTS_ZIP=1
) )
# PhysFS needs some extensions...
if(${CMAKE_VERSION} VERSION_GREATER "3.1.3"
OR ${CMAKE_VERSION} VERSION_EQUAL "3.1.3")
set_property(TARGET physfs-static PROPERTY C_EXTENSIONS ON)
endif()
target_link_libraries(VVVVVV physfs-static tinyxml2-static lodepng-static) target_link_libraries(VVVVVV physfs-static tinyxml2-static lodepng-static)
else() else()
find_package(utf8cpp CONFIG) find_package(utf8cpp CONFIG)