aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-07-07 17:44:09 -0700
committerRobert Schumacher <roschuma@microsoft.com>2017-07-07 17:44:23 -0700
commit09bce9186ef205c62882b42dc117e421d1a3ad90 (patch)
treeb80d4b61abbded2204a73474e259145f5c04a18f
parent1eedcc9b00ae0c0fa4505e84cb0e1141e8c42696 (diff)
downloadvcpkg-09bce9186ef205c62882b42dc117e421d1a3ad90.tar.gz
vcpkg-09bce9186ef205c62882b42dc117e421d1a3ad90.zip
[sdl2-gfx] Small cleanup, better support static linking
-rw-r--r--ports/sdl2-gfx/CMakeLists.txt12
-rw-r--r--ports/sdl2-gfx/CONTROL2
-rw-r--r--ports/sdl2-gfx/portfile.cmake11
3 files changed, 7 insertions, 18 deletions
diff --git a/ports/sdl2-gfx/CMakeLists.txt b/ports/sdl2-gfx/CMakeLists.txt
index 7cc35ccb0..d0a9f0c82 100644
--- a/ports/sdl2-gfx/CMakeLists.txt
+++ b/ports/sdl2-gfx/CMakeLists.txt
@@ -5,9 +5,10 @@ find_path(SDL_INCLUDE_DIR SDL2/SDL.h)
find_library(SDL_LIBRARY SDL2)
# builtin formats
-set(SDL_GFX_DEFINES
- WIN32
- DLL_EXPORT)
+set(SDL_GFX_DEFINES WIN32)
+if(BUILD_SHARED_LIBS)
+ list(APPEND SDL_GFX_DEFINES DLL_EXPORT)
+endif()
add_library(SDL2_gfx
SDL2_framerate.c
@@ -17,7 +18,7 @@ add_library(SDL2_gfx
target_compile_definitions(SDL2_gfx PRIVATE ${SDL_GFX_DEFINES})
target_include_directories(SDL2_gfx PRIVATE ${SDL_INCLUDE_DIR}/SDL2)
-target_link_libraries(SDL2_gfx ${SDL_LIBRARY})
+target_link_libraries(SDL2_gfx PRIVATE ${SDL_LIBRARY})
install(TARGETS SDL2_gfx
RUNTIME DESTINATION bin
@@ -27,6 +28,3 @@ install(TARGETS SDL2_gfx
if(NOT SDL_GFX_SKIP_HEADERS)
install(FILES SDL2_framerate.h SDL2_gfxPrimitives.h SDL2_imageFilter.h SDL2_rotozoom.h SDL2_gfxPrimitives_font.h DESTINATION include/SDL2)
endif()
-
-message(STATUS "Link-time dependencies:")
-message(STATUS " " ${SDL_LIBRARY})
diff --git a/ports/sdl2-gfx/CONTROL b/ports/sdl2-gfx/CONTROL
index cecb70f0a..799306235 100644
--- a/ports/sdl2-gfx/CONTROL
+++ b/ports/sdl2-gfx/CONTROL
@@ -1,4 +1,4 @@
Source: sdl2-gfx
-Version: 1.0.3
+Version: 1.0.3-1
Build-Depends: sdl2
Description: Graphics primitives (line, circle, rectangle etc.) with AA support, rotozoomer and other drawing related support functions wrapped up in a C based add-on library for the Simple Direct Media (SDL) cross-platform API layer.
diff --git a/ports/sdl2-gfx/portfile.cmake b/ports/sdl2-gfx/portfile.cmake
index 50c23372b..f7c2d63f6 100644
--- a/ports/sdl2-gfx/portfile.cmake
+++ b/ports/sdl2-gfx/portfile.cmake
@@ -1,11 +1,3 @@
-# Common Ambient Variables:
-# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
-# TARGET_TRIPLET is the current triplet (x86-windows, etc)
-# PORT is the current port name (zlib, etc)
-# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
-# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
-#
-
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/SDL2_gfx-1.0.3)
vcpkg_download_distfile(ARCHIVE
@@ -18,12 +10,11 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
+ OPTIONS_DEBUG -DSDL_GFX_SKIP_HEADERS=1
)
vcpkg_install_cmake()
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
-
# Handle copyright
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/sdl2-gfx)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/sdl2-gfx/COPYING ${CURRENT_PACKAGES_DIR}/share/sdl2-gfx/copyright)