aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcodicodi <rob.ceglinski@gmail.com>2017-07-21 13:01:00 +0200
committercodicodi <rob.ceglinski@gmail.com>2017-07-21 13:01:00 +0200
commitdc4998bf702b14f51f36ab40d85d3b090d5bfa9c (patch)
tree2c736c694c2aeacf839ae58226b2b90cedac55bd
parenta42da34a07187063da297b422a95dbb2d7bd064a (diff)
downloadvcpkg-dc4998bf702b14f51f36ab40d85d3b090d5bfa9c.tar.gz
vcpkg-dc4998bf702b14f51f36ab40d85d3b090d5bfa9c.zip
[sdl2] Prevent exports in static build
-rw-r--r--ports/sdl2-image/CMakeLists.txt92
-rw-r--r--ports/sdl2-image/CONTROL2
-rw-r--r--ports/sdl2-image/portfile.cmake1
-rw-r--r--ports/sdl2-mixer/CMakeLists.txt1
-rw-r--r--ports/sdl2-mixer/CONTROL2
-rw-r--r--ports/sdl2-net/CMakeLists.txt1
-rw-r--r--ports/sdl2-net/CONTROL2
-rw-r--r--ports/sdl2-ttf/CMakeLists.txt1
-rw-r--r--ports/sdl2-ttf/CONTROL2
-rw-r--r--ports/sdl2/CONTROL2
-rw-r--r--ports/sdl2/export-symbols-only-in-shared-build.patch16
-rw-r--r--ports/sdl2/portfile.cmake1
-rw-r--r--ports/smpeg2/CMakeLists.txt3
-rw-r--r--ports/smpeg2/CONTROL2
-rw-r--r--ports/smpeg2/portfile.cmake1
15 files changed, 77 insertions, 52 deletions
diff --git a/ports/sdl2-image/CMakeLists.txt b/ports/sdl2-image/CMakeLists.txt
index e742a408d..8b5f7131f 100644
--- a/ports/sdl2-image/CMakeLists.txt
+++ b/ports/sdl2-image/CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.6)
-project(SDL2_image)
+project(SDL2_image C)
### configuration ###
@@ -27,24 +27,26 @@ set(WEBP_DYNAMIC \"libwebp-4.dll\")
add_library(SDL2_image
IMG.c
- IMG_bmp.c
- IMG_gif.c
- IMG_jpg.c
- IMG_lbm.c
- IMG_pcx.c
- IMG_png.c
- IMG_pnm.c
- IMG_tga.c
- IMG_tif.c
- IMG_webp.c
- IMG_xcf.c
- IMG_xpm.c
- IMG_xv.c
- IMG_xxx.c
- )
+ IMG_bmp.c
+ IMG_gif.c
+ IMG_jpg.c
+ IMG_lbm.c
+ IMG_pcx.c
+ IMG_png.c
+ IMG_pnm.c
+ IMG_tga.c
+ IMG_tif.c
+ IMG_webp.c
+ IMG_xcf.c
+ IMG_xpm.c
+ IMG_xv.c
+ IMG_xxx.c
+ )
+
+set_target_properties(SDL2_image PROPERTIES DEFINE_SYMBOL SDL2_EXPORTS)
foreach(FORMAT ${SUPPORTED_FORMATS})
- add_definitions(-DLOAD_${FORMAT})
+ add_definitions(-DLOAD_${FORMAT})
endforeach(FORMAT)
# SDL
@@ -59,27 +61,27 @@ target_link_libraries(SDL2_image ${SDL_LIBRARY})
# external dependencies
foreach(DEPENDENCY ${DEPENDENCIES})
- find_package(${DEPENDENCY})
-
- if(NOT DEFINED ${DEPENDENCY}_FLAG)
- set(${DEPENDENCY}_FLAG ${DEPENDENCY})
- endif()
-
- add_definitions(-DLOAD_${${DEPENDENCY}_FLAG})
- if(${DEPENDENCY}_FOUND)
- message(STATUS " --> linking statically.")
- target_link_libraries(SDL2_image ${${DEPENDENCY}_LIBRARIES})
- elseif(DEFINED ${DEPENDENCY}_DYNAMIC)
- message(STATUS " --> linking dynamically.")
- add_definitions(-DLOAD_${${DEPENDENCY}_FLAG}_DYNAMIC=${${DEPENDENCY}_DYNAMIC})
- set(RUNTIME_DEPENDENCIES ON)
- else()
- message(STATUS " --> skipping.")
- endif()
+ find_package(${DEPENDENCY})
+
+ if(NOT DEFINED ${DEPENDENCY}_FLAG)
+ set(${DEPENDENCY}_FLAG ${DEPENDENCY})
+ endif()
+
+ add_definitions(-DLOAD_${${DEPENDENCY}_FLAG})
+ if(${DEPENDENCY}_FOUND)
+ message(STATUS " --> linking statically.")
+ target_link_libraries(SDL2_image ${${DEPENDENCY}_LIBRARIES})
+ elseif(DEFINED ${DEPENDENCY}_DYNAMIC)
+ message(STATUS " --> linking dynamically.")
+ add_definitions(-DLOAD_${${DEPENDENCY}_FLAG}_DYNAMIC=${${DEPENDENCY}_DYNAMIC})
+ set(RUNTIME_DEPENDENCIES ON)
+ else()
+ message(STATUS " --> skipping.")
+ endif()
endforeach(DEPENDENCY)
if(DEFINED RUNTIME_DEPENDENCIES)
- include_directories(VisualC/external/include)
+ include_directories(VisualC/external/include)
endif()
@@ -94,16 +96,16 @@ install(FILES SDL_image.h DESTINATION include/SDL2 CONFIGURATIONS Release)
message(STATUS "Link-time dependencies:")
message(STATUS " " ${SDL_LIBRARY})
foreach(DEPENDENCY ${DEPENDENCIES})
- if(${DEPENDENCY}_FOUND)
- message(STATUS " " ${DEPENDENCY})
- endif()
+ if(${DEPENDENCY}_FOUND)
+ message(STATUS " " ${DEPENDENCY})
+ endif()
endforeach(DEPENDENCY)
if(DEFINED RUNTIME_DEPENDENCIES)
- message(STATUS "Run-time dependencies:")
- foreach(DEPENDENCY ${DEPENDENCIES})
- if(NOT ${DEPENDENCY}_FOUND AND DEFINED ${DEPENDENCY}_DYNAMIC)
- message(STATUS " " ${${DEPENDENCY}_DYNAMIC})
- endif()
- endforeach(DEPENDENCY)
-endif() \ No newline at end of file
+ message(STATUS "Run-time dependencies:")
+ foreach(DEPENDENCY ${DEPENDENCIES})
+ if(NOT ${DEPENDENCY}_FOUND AND DEFINED ${DEPENDENCY}_DYNAMIC)
+ message(STATUS " " ${${DEPENDENCY}_DYNAMIC})
+ endif()
+ endforeach(DEPENDENCY)
+endif()
diff --git a/ports/sdl2-image/CONTROL b/ports/sdl2-image/CONTROL
index 04c9f77bb..5ebec2f38 100644
--- a/ports/sdl2-image/CONTROL
+++ b/ports/sdl2-image/CONTROL
@@ -1,5 +1,5 @@
Source: sdl2-image
-Version: 2.0.1
+Version: 2.0.1-1
Build-Depends: sdl2, libpng, libjpeg-turbo, tiff, libwebp
Description: SDL_image is an image file loading library. It loads images as SDL surfaces and textures, and supports the following formats: BMP, GIF, JPEG, LBM, PCX, PNG, PNM, TGA, TIFF, WEBP, XCF, XPM, XV
diff --git a/ports/sdl2-image/portfile.cmake b/ports/sdl2-image/portfile.cmake
index 4cc6ce74a..ad3f1a2d5 100644
--- a/ports/sdl2-image/portfile.cmake
+++ b/ports/sdl2-image/portfile.cmake
@@ -25,6 +25,7 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindWEBP.cmake DESTINATION ${SOURCE_PATH}/cm
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
# OPTIONS
# OPTIONS_RELEASE -DOPTIMIZE=1
# OPTIONS_DEBUG -DDEBUGGABLE=1
diff --git a/ports/sdl2-mixer/CMakeLists.txt b/ports/sdl2-mixer/CMakeLists.txt
index 094912b48..6d1cb28c0 100644
--- a/ports/sdl2-mixer/CMakeLists.txt
+++ b/ports/sdl2-mixer/CMakeLists.txt
@@ -76,6 +76,7 @@ add_library(SDL2_mixer
native_midi/native_midi_common.c
native_midi/native_midi_win32.c)
+set_target_properties(SDL2_mixer PROPERTIES DEFINE_SYMBOL SDL2_EXPORTS)
target_compile_definitions(SDL2_mixer PRIVATE ${SDL_MIXER_DEFINES})
target_include_directories(SDL2_mixer PRIVATE ${SDL_MIXER_INCLUDES} ./native_midi)
target_link_libraries(SDL2_mixer ${SDL_MIXER_LIBRARIES} Winmm)
diff --git a/ports/sdl2-mixer/CONTROL b/ports/sdl2-mixer/CONTROL
index b5d51aecd..88356b73f 100644
--- a/ports/sdl2-mixer/CONTROL
+++ b/ports/sdl2-mixer/CONTROL
@@ -1,4 +1,4 @@
Source: sdl2-mixer
-Version: 2.0.1
+Version: 2.0.1-1
Description: Multi-channel audio mixer library for SDL.
Build-Depends: sdl2, libflac, smpeg2, libmodplug, libvorbis
diff --git a/ports/sdl2-net/CMakeLists.txt b/ports/sdl2-net/CMakeLists.txt
index d87b88c89..9b81f8d42 100644
--- a/ports/sdl2-net/CMakeLists.txt
+++ b/ports/sdl2-net/CMakeLists.txt
@@ -8,6 +8,7 @@ find_library(SDL_LIBRARY SDL2)
add_library(SDL2_net SDLnet.c SDLnetselect.c SDLnetTCP.c SDLnetUDP.c)
+set_target_properties(SDL2_net PROPERTIES DEFINE_SYMBOL SDL2_EXPORTS)
target_compile_definitions(SDL2_net PRIVATE _WINSOCK_DEPRECATED_NO_WARNINGS)
target_include_directories(SDL2_net PRIVATE ${SDL_INCLUDE_DIR}/SDL2)
target_link_libraries(SDL2_net ${SDL_LIBRARY} ws2_32 iphlpapi)
diff --git a/ports/sdl2-net/CONTROL b/ports/sdl2-net/CONTROL
index 850cc9163..692bb7615 100644
--- a/ports/sdl2-net/CONTROL
+++ b/ports/sdl2-net/CONTROL
@@ -1,4 +1,4 @@
Source: sdl2-net
-Version: 2.0.1
+Version: 2.0.1-1
Description: Networking library for SDL
Build-Depends: sdl2
diff --git a/ports/sdl2-ttf/CMakeLists.txt b/ports/sdl2-ttf/CMakeLists.txt
index f2e677483..133616479 100644
--- a/ports/sdl2-ttf/CMakeLists.txt
+++ b/ports/sdl2-ttf/CMakeLists.txt
@@ -7,6 +7,7 @@ find_package(FreeType REQUIRED)
add_library(SDL2_ttf SDL_ttf.c)
+set_target_properties(SDL2_ttf PROPERTIES DEFINE_SYMBOL SDL2_EXPORTS)
target_include_directories(SDL2_ttf PRIVATE ${SDL_INCLUDE_DIR}/SDL2 ${FREETYPE_INCLUDE_DIR_ft2build})
target_link_libraries(SDL2_ttf ${SDL_LIBRARY} ${FREETYPE_LIBRARY})
diff --git a/ports/sdl2-ttf/CONTROL b/ports/sdl2-ttf/CONTROL
index de0385428..fe09831ee 100644
--- a/ports/sdl2-ttf/CONTROL
+++ b/ports/sdl2-ttf/CONTROL
@@ -1,4 +1,4 @@
Source: sdl2-ttf
-Version: 2.0.14
+Version: 2.0.14-1
Description: A library for rendering TrueType fonts with SDL
Build-Depends: sdl2, freetype
diff --git a/ports/sdl2/CONTROL b/ports/sdl2/CONTROL
index c0d747691..f22820579 100644
--- a/ports/sdl2/CONTROL
+++ b/ports/sdl2/CONTROL
@@ -1,3 +1,3 @@
Source: sdl2
-Version: 2.0.5-2
+Version: 2.0.5-3
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/sdl2/export-symbols-only-in-shared-build.patch b/ports/sdl2/export-symbols-only-in-shared-build.patch
new file mode 100644
index 000000000..b442954d5
--- /dev/null
+++ b/ports/sdl2/export-symbols-only-in-shared-build.patch
@@ -0,0 +1,16 @@
+diff --git a/include/begin_code.h b/include/begin_code.h
+index 04e78c6..16464f5 100644
+--- a/include/begin_code.h
++++ b/include/begin_code.h
+@@ -58,8 +58,10 @@
+ # else
+ # define DECLSPEC __declspec(dllimport)
+ # endif
+-# else
++# elif defined(SDL2_EXPORTS)
+ # define DECLSPEC __declspec(dllexport)
++# else
++# define DECLSPEC
+ # endif
+ # else
+ # if defined(__GNUC__) && __GNUC__ >= 4
diff --git a/ports/sdl2/portfile.cmake b/ports/sdl2/portfile.cmake
index 185e39665..33123c1ba 100644
--- a/ports/sdl2/portfile.cmake
+++ b/ports/sdl2/portfile.cmake
@@ -11,6 +11,7 @@ vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/dont-ignore-default-libs.patch
+ ${CMAKE_CURRENT_LIST_DIR}/export-symbols-only-in-shared-build.patch
)
if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore")
diff --git a/ports/smpeg2/CMakeLists.txt b/ports/smpeg2/CMakeLists.txt
index 9f061cfb8..7cda2840a 100644
--- a/ports/smpeg2/CMakeLists.txt
+++ b/ports/smpeg2/CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.6)
-project(SMPEG2)
+project(SMPEG2 CXX)
find_path(SDL_INCLUDE_DIR SDL2/SDL.h)
find_library(SDL_LIBRARY SDL2)
@@ -42,6 +42,7 @@ add_library(smpeg2
MPEGsystem.cpp
smpeg.cpp)
+set_target_properties(smpeg2 PROPERTIES DEFINE_SYMBOL SDL2_EXPORTS)
target_link_libraries(smpeg2 ${SDL_LIBRARY})
install(TARGETS smpeg2
diff --git a/ports/smpeg2/CONTROL b/ports/smpeg2/CONTROL
index 8465a6446..26c0b3904 100644
--- a/ports/smpeg2/CONTROL
+++ b/ports/smpeg2/CONTROL
@@ -1,4 +1,4 @@
Source: smpeg2
-Version: 2.0.0
+Version: 2.0.0-1
Description: SDL MPEG Player Library
Build-Depends: sdl2
diff --git a/ports/smpeg2/portfile.cmake b/ports/smpeg2/portfile.cmake
index 43e6e623e..7639ca264 100644
--- a/ports/smpeg2/portfile.cmake
+++ b/ports/smpeg2/portfile.cmake
@@ -17,6 +17,7 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
OPTIONS_DEBUG
-DSMPEG_SKIP_HEADERS=ON)