Unix: CMakeLists.txt compat fixes, suppress fewer warnings

`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.
This commit is contained in:
Thomas Otto 2024-04-16 23:21:55 +02:00
parent d931b77e2b
commit 67d68f1f4d

View File

@ -14,14 +14,17 @@ PROJECT(Descent3)
IF (UNIX)
SET (D3_GAMEDIR "~/Descent3/")
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_C_COMPILER "gcc")
IF (NOT APPLE)
LIST(APPEND CMAKE_CXX_FLAGS "-m32")
LIST(APPEND CMAKE_C_FLAGS "-m32")
IF (APPLE)
SET(EXTRA_CXX_FLAGS "-Wno-address-of-temporary")
ELSE()
SET(EXTRA_CXX_FLAGS "-fpermissive")
ENDIF()
SET(CMAKE_CXX_COMPILER "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")
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