Skip to content

Commit

Permalink
Unix: CMakeLists.txt compat fixes, suppress fewer warnings
Browse files Browse the repository at this point in the history
`LIST(APPEND ..)` adds a `;` to the gcc command line, replaced with string
interpolation.

Only use "-Wno-address-of-temporary" on macOS (=clang),
on Linux/gcc use "-fpermissive" which still shows the compiler warning
so it can be fixed later.
  • Loading branch information
th1000s committed Apr 16, 2024
1 parent 61be131 commit 90583a7
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@ PROJECT(Descent3)
IF (UNIX)
SET (D3_GAMEDIR "~/Descent3/")

IF (APPLE)
SET(BITS "-m64")
SET(EXTRA_CXX_FLAGS "-Wno-address-of-temporary")
ELSE()
SET(BITS "-m32")
SET(EXTRA_CXX_FLAGS "-fpermissive")
ENDIF()

SET(CMAKE_CXX_COMPILER "g++")
SET(CMAKE_CXX_FLAGS "-O0 -g -Wno-write-strings -Wno-multichar -Wno-address-of-temporary")
SET(CMAKE_C_FLAGS "-O0 -g")
SET(CMAKE_CXX_FLAGS "-O0 -g -Wno-write-strings -Wno-multichar ${BITS} ${EXTRA_CXX_FLAGS}")
SET(CMAKE_C_FLAGS "-O0 -g ${BITS}")
SET(CMAKE_C_COMPILER "gcc")
IF (NOT APPLE)
LIST(APPEND CMAKE_CXX_FLAGS "-m32")
LIST(APPEND CMAKE_C_FLAGS "-m32")
ENDIF()

FIND_PACKAGE( SDL REQUIRED )
IF (APPLE)
# Provide FIND_PACKAGE( SDL_image ) below with an include dir and library that work with brew-installed sdl2_image
Expand Down

0 comments on commit 90583a7

Please sign in to comment.