Commit 71e90145 authored by Martin Kozub's avatar Martin Kozub

Ading patch to build SDL2pp statically

parent 1d64e194
......@@ -388,7 +388,7 @@ ExternalProject_Add(SDL2pp_build
URL ${SDL2pp_SRC}
# patch #1: SDL2pp currently builds only shared library in standalone mode but we want static
# patch #2: fix include paths when SDL_image is installed into a directory other than where SDL itself is installed
# PATCH_COMMAND patch -p1 < "${CMAKE_CURRENT_SOURCE_DIR}/patches/sdl2pp.patch"
PATCH_COMMAND patch -p1 < "${CMAKE_CURRENT_SOURCE_DIR}/patches/sdl2pp-make-lib-static.patch"
# due to the way cmake handles ';' in strings (lists), use ':' and let ExternalProject
# replace these by ';'
LIST_SEPARATOR ":"
......
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f539296..b554caa 100644
index c831586..acb4143 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -209,7 +209,7 @@ INCLUDE(GenerateExportHeader)
@@ -204,7 +204,7 @@ IF(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
OPTION(SDL2PP_WITH_EXAMPLES "Build examples" ON)
OPTION(SDL2PP_WITH_TESTS "Build tests" ON)
OPTION(SDL2PP_ENABLE_LIVE_TESTS "Enable live tests (require X11 display and audio device)" ON)
- OPTION(SDL2PP_STATIC "Build static library instead of shared one" OFF)
+ OPTION(SDL2PP_STATIC "Build static library instead of shared one" ON)
IF(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
# library
- ADD_LIBRARY(SDL2pp SHARED ${LIBRARY_SOURCES} ${LIBRARY_HEADERS})
+ ADD_LIBRARY(SDL2pp STATIC ${LIBRARY_SOURCES} ${LIBRARY_HEADERS})
GENERATE_EXPORT_HEADER(SDL2pp EXPORT_FILE_NAME SDL2pp/Export.hh)
TARGET_LINK_LIBRARIES(SDL2pp ${SDL2_ALL_LIBRARIES})
SET_TARGET_PROPERTIES(SDL2pp PROPERTIES VERSION 8.0.0 SOVERSION 8)
IF(SDL2PP_STATIC)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment