mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Bring the CMakeLists.txt more inline with the Makefile:
* Always set -fvisibility=hidden * Set -Wl,--no-undefined where it is supported * Add missing libraries for Windows
This commit is contained in:
parent
257075c928
commit
0cdfd8f292
1 changed files with 13 additions and 5 deletions
|
@ -29,7 +29,8 @@ list(APPEND CMAKE_PREFIX_PATH /usr/local)
|
||||||
# -Wall -> More warnings
|
# -Wall -> More warnings
|
||||||
# -fno-strict-aliasing -> Quake 2 is far away from strict aliasing
|
# -fno-strict-aliasing -> Quake 2 is far away from strict aliasing
|
||||||
# -fwrapv -> Make signed integer overflows defined
|
# -fwrapv -> Make signed integer overflows defined
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -fno-strict-aliasing -fwrapv")
|
# -fvisibility=hidden -> Force defaultsymbol visibility to hidden
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -fno-strict-aliasing -fwrapv -fvisibility=hidden")
|
||||||
|
|
||||||
# Switch of some annoying warnings
|
# Switch of some annoying warnings
|
||||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
|
@ -147,17 +148,24 @@ if(${OPENAL_SUPPORT})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# General linker flags.
|
# General linker flags.
|
||||||
|
list(APPEND yquake2LinkerFlags "-lm")
|
||||||
|
list(APPEND yquake2LinkerFlags ${CMAKE_DL_LIBS})
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||||
list(APPEND yquake2LinkerFlags "-lm -static-libgcc")
|
list(APPEND yquake2LinkerFlags "-lws2_32 -lwinmm -static-libgcc")
|
||||||
else()
|
else()
|
||||||
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Haiku")
|
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Haiku")
|
||||||
list(APPEND yquake2LinkerFlags "-lm -rdynamic")
|
list(APPEND yquake2LinkerFlags "-rdynamic")
|
||||||
else()
|
else()
|
||||||
list(APPEND yquake2LinkerFlags "-lm -lnetwork")
|
list(APPEND yquake2LinkerFlags "-lnetwork")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND yquake2LinkerFlags ${CMAKE_DL_LIBS})
|
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
|
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
|
||||||
|
list(APPEND yquake2LinkerFlags "-Wl,--no-undefined")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# With all of those libraries and user defined paths
|
# With all of those libraries and user defined paths
|
||||||
# added, lets give them to the compiler and linker.
|
# added, lets give them to the compiler and linker.
|
||||||
|
|
Loading…
Reference in a new issue