mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2024-12-05 00:38:00 +01:00
cmake: rework static linking configuration
This commit is contained in:
parent
c6ef4a6199
commit
6758075511
2 changed files with 16 additions and 11 deletions
|
@ -23,11 +23,11 @@ if (APPLE)
|
|||
endif(APPLE)
|
||||
install(TARGETS ${EXECUTABLE} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
add_library("lib${LIBSUPERDERPY_GAMENAME}" SHARED ${SHARED_SRC_LIST})
|
||||
else(BUILD_SHARED_LIBS)
|
||||
if (LIBSUPERDERPY_STATIC_COMMON)
|
||||
add_library("lib${LIBSUPERDERPY_GAMENAME}" STATIC ${SHARED_SRC_LIST})
|
||||
endif(BUILD_SHARED_LIBS)
|
||||
else(LIBSUPERDERPY_STATIC_COMMON)
|
||||
add_library("lib${LIBSUPERDERPY_GAMENAME}" SHARED ${SHARED_SRC_LIST})
|
||||
endif(LIBSUPERDERPY_STATIC_COMMON)
|
||||
|
||||
set_target_properties("lib${LIBSUPERDERPY_GAMENAME}" PROPERTIES PREFIX "")
|
||||
target_link_libraries("lib${LIBSUPERDERPY_GAMENAME}" libsuperderpy ${LIBSUPERDERPY_EXTRA_LIBS})
|
||||
|
|
|
@ -169,24 +169,29 @@ if (NOT LIBSUPERDERPY_CONFIG_INCLUDED)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
option(BUILD_SHARED_LIBS "Use dynamic linking" ON)
|
||||
option(BUILD_SHARED_LIBS "Build as dynamic libraries" ON)
|
||||
|
||||
option(LIBSUPERDERPY_STATIC "Compile and link libsuperderpy as a static library" OFF)
|
||||
option(LIBSUPERDERPY_STATIC_COMMON "Compile and link common routines as a static library" OFF)
|
||||
option(LIBSUPERDERPY_STATIC_GAMESTATES "Compile and link gamestates as static libraries" OFF)
|
||||
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
set(STATIC_DEFAULT ON)
|
||||
else()
|
||||
set(STATIC_DEFAULT OFF)
|
||||
set(LIBSUPERDERPY_STATIC ON)
|
||||
set(LIBSUPERDERPY_STATIC_COMMON ON)
|
||||
set(LIBSUPERDERPY_STATIC_GAMESTATES ON)
|
||||
endif()
|
||||
|
||||
option(LIBSUPERDERPY_STATIC "Compile and link libsuperderpy as a static library." ${STATIC_DEFAULT})
|
||||
option(LIBSUPERDERPY_STATIC_GAMESTATES "Compile and link gamestates as static libraries" ${STATIC_DEFAULT})
|
||||
if(LIBSUPERDERPY_STATIC_GAMESTATES)
|
||||
add_definitions("-DLIBSUPERDERPY_STATIC_GAMESTATES")
|
||||
endif(LIBSUPERDERPY_STATIC_GAMESTATES)
|
||||
|
||||
option(LIBSUPERDERPY_STATIC_DEPS "Link dependencies (e.g. Allegro) statically." ${STATIC_DEFAULT})
|
||||
option(LIBSUPERDERPY_STATIC_DEPS "Link dependencies (e.g. Allegro) statically." OFF)
|
||||
if(LIBSUPERDERPY_STATIC_DEPS)
|
||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a)
|
||||
endif(LIBSUPERDERPY_STATIC_DEPS)
|
||||
|
||||
set(LIBSUPERDERPY_EXTRA_LIBS "${LIBSUPERDERPY_EXTRA_LIBS_INIT}" CACHE STRING "Additional platform libraries to link to")
|
||||
|
||||
if(MAEMO5)
|
||||
add_definitions(-DMAEMO5=1)
|
||||
add_definitions(-D_Noreturn=)
|
||||
|
|
Loading…
Reference in a new issue