From 228289f4506a6a47d7eeb9401f9746d3ecce523f Mon Sep 17 00:00:00 2001 From: MistGebaut <49169052+MistGebaut@users.noreply.github.com> Date: Tue, 2 Apr 2019 19:48:36 +0200 Subject: sdl1: static build (#5903) * sdl1: static build * Update CONTROL file --- ports/sdl1/CONTROL | 2 +- ports/sdl1/portfile.cmake | 10 ++++-- ports/sdl1/static-build.patch | 74 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 ports/sdl1/static-build.patch diff --git a/ports/sdl1/CONTROL b/ports/sdl1/CONTROL index 483813f51..9d9e856f6 100644 --- a/ports/sdl1/CONTROL +++ b/ports/sdl1/CONTROL @@ -1,3 +1,3 @@ Source: sdl1 -Version: 1.2.15-3 +Version: 1.2.15-4 Description: Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. diff --git a/ports/sdl1/portfile.cmake b/ports/sdl1/portfile.cmake index de2d855e6..c3e580fbb 100644 --- a/ports/sdl1/portfile.cmake +++ b/ports/sdl1/portfile.cmake @@ -1,7 +1,5 @@ include(vcpkg_common_functions) -vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO SDL-Mirror/SDL @@ -17,6 +15,14 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/SDLmain.vcxproj DESTINATION ${SOURCE_PATH}/V configure_file(${SOURCE_PATH}/include/SDL_config.h.default ${SOURCE_PATH}/include/SDL_config.h COPYONLY) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/static-build.patch + ) +endif() + # This text file gets copied as a library, and included as one in the package file(REMOVE_RECURSE ${SOURCE_PATH}/src/hermes/COPYING.LIB) diff --git a/ports/sdl1/static-build.patch b/ports/sdl1/static-build.patch new file mode 100644 index 000000000..89bc39ddc --- /dev/null +++ b/ports/sdl1/static-build.patch @@ -0,0 +1,74 @@ +--- a/VisualC/SDL/SDL.vcxproj Sun Mar 31 11:28:40 2019 ++++ b/VisualC/SDL/SDL.vcxproj Sun Mar 31 19:00:00 2019 +@@ -26,3 +26,3 @@ + +- DynamicLibrary ++ StaticLibrary + v141 +@@ -31,3 +31,3 @@ + +- DynamicLibrary ++ StaticLibrary + v141 +@@ -36,3 +36,3 @@ + +- DynamicLibrary ++ StaticLibrary + v141 +@@ -41,3 +41,3 @@ + +- DynamicLibrary ++ StaticLibrary + v141 +@@ -100,3 +100,3 @@ + _CRT_SECURE_NO_DEPRECATE;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0400;%(PreprocessorDefinitions) +- MultiThreadedDLL ++ MultiThreadedDebug + false +@@ -137,3 +137,3 @@ + _CRT_SECURE_NO_DEPRECATE;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0400;%(PreprocessorDefinitions) +- MultiThreadedDLL ++ MultiThreadedDebug + false +@@ -176,3 +176,3 @@ + true +- MultiThreadedDLL ++ MultiThreaded + false +@@ -213,3 +213,3 @@ + true +- MultiThreadedDLL ++ MultiThreaded + false +--- a/VisualC/SDLmain/SDLmain.vcxproj Sun Mar 31 11:28:40 2019 ++++ b/VisualC/SDLmain/SDLmain.vcxproj Sun Mar 31 19:00:00 2019 +@@ -123,3 +123,3 @@ + true +- MultiThreadedDLL ++ MultiThreaded + true +@@ -140,3 +140,3 @@ + true +- MultiThreadedDLL ++ MultiThreaded + true +@@ -154,3 +154,3 @@ + true +- MultiThreadedDLL ++ MultiThreaded + true +@@ -171,3 +171,3 @@ + true +- MultiThreadedDLL ++ MultiThreaded + true +@@ -184,3 +184,3 @@ + _CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) +- MultiThreadedDLL ++ MultiThreadedDebug + +@@ -200,3 +200,3 @@ + _CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) +- MultiThreadedDLL ++ MultiThreadedDebug + -- cgit v1.2.3