mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 13:49:40 +00:00
static sdl2 compilation option for Unixes that are not Apple
This commit is contained in:
parent
9c6fa29938
commit
84a8ea4ef7
2 changed files with 9 additions and 0 deletions
|
@ -31,6 +31,7 @@ configure_file ("${OpenMW_SOURCE_DIR}/Docs/mainpage.hpp.cmake" "${OpenMW_SOURCE_
|
||||||
option(MYGUI_STATIC "Link static build of Mygui into the binaries" FALSE)
|
option(MYGUI_STATIC "Link static build of Mygui into the binaries" FALSE)
|
||||||
option(OGRE_STATIC "Link static build of Ogre and Ogre Plugins into the binaries" FALSE)
|
option(OGRE_STATIC "Link static build of Ogre and Ogre Plugins into the binaries" FALSE)
|
||||||
option(BOOST_STATIC "Link static build of Boost into the binaries" FALSE)
|
option(BOOST_STATIC "Link static build of Boost into the binaries" FALSE)
|
||||||
|
option(SDL2_STATIC "Link static build of SDL into the binaries" FALSE)
|
||||||
|
|
||||||
# Apps and tools
|
# Apps and tools
|
||||||
option(BUILD_BSATOOL "build BSA extractor" OFF)
|
option(BUILD_BSATOOL "build BSA extractor" OFF)
|
||||||
|
|
|
@ -183,3 +183,11 @@ INCLUDE(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2
|
||||||
REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)
|
REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)
|
||||||
|
|
||||||
|
IF(SDL2_STATIC)
|
||||||
|
if (UNIX AND NOT APPLE)
|
||||||
|
EXECUTE_PROCESS(COMMAND sdl2-config --static-libs OUTPUT_VARIABLE SDL2_LINK_FLAGS)
|
||||||
|
STRING(REGEX REPLACE "(\r?\n)+$" "" SDL2_LINK_FLAGS "${SDL2_LINK_FLAGS}")
|
||||||
|
SET(SDL2_LIBRARY ${SDL2_LINK_FLAGS})
|
||||||
|
ENDIF()
|
||||||
|
ENDIF(SDL2_STATIC)
|
||||||
|
|
Loading…
Reference in a new issue