Skip to content

Commit 869b18c

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. Reported in issue #20.
1 parent 0a7e3c9 commit 869b18c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ project(yquake2-ctf)
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=gnu99 -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)