Skip to content

Commit c17268a

Browse files
jfsmigfvennetier
authored andcommitted
cmake: Fix the build with various gcc versions
1 parent 7c8fcc9 commit c17268a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

CMakeLists.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if (FRAMES)
2929
set(SAN_CFLAGS "${SAN_CFLAGS} -fstack-protector-all")
3030
endif ()
3131

32-
set(CMAKE_C_FLAGS "-g -Wall -Wextra -Wunused -pipe -std=gnu99")
32+
set(CMAKE_C_FLAGS "-Wall -Wextra -Wunused -pipe -std=gnu99")
3333
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
3434

3535
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
@@ -51,7 +51,6 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
5151
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion")
5252
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wswitch-enum")
5353
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused")
54-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused-const-variable")
5554
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused-parameter")
5655
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused-variable")
5756
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused-macros")
@@ -84,9 +83,9 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebIn
8483
MESSAGE("DEBUG symbols enabled")
8584
endif()
8685

87-
set(CMAKE_C_FLAGS_DEBUG "-Og -fno-inline")
88-
set(CMAKE_C_FLAGS_RELEASE "-O2")
89-
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2")
86+
set(CMAKE_C_FLAGS_DEBUG "-g -O0 -fno-inline")
87+
set(CMAKE_C_FLAGS_RELEASE "-g -O2")
88+
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O2")
9089
set(CMAKE_C_FLAGS_MINSIZEREL "-Os")
9190

9291
add_definitions(-D_REENTRANT)

0 commit comments

Comments
 (0)