Skip to content

Commit 062d836

Browse files
committed
Force C standard to gnu99 in cmake builds.
The Makefiles forces gnu99 since ages. Additionally gcc15 started to default to C23 and our code doesn't (yet) build with it.
1 parent 6ca882d commit 062d836

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ project(yquake2-xatrix)
1313

1414
# Enforce compiler flags (GCC / Clang compatible, yquake2
1515
# won't build with another compiler anyways)
16+
# -std=gnu99 -> Force same C standard as in the Makefile
1617
# -Wall -> More warnings
1718
# -fno-strict-aliasing -> Quake 2 is far away from strict aliasing
1819
# -fwrapv -> Make signed integer overflows defined
19-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fno-strict-aliasing -fwrapv")
20+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -fno-strict-aliasing -fwrapv")
2021

2122
# Use -O2 as maximum optimization level. -O3 has it's problems with yquake2.
2223
string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")

0 commit comments

Comments
 (0)