diff options
| author | codicodi <rob.ceglinski@gmail.com> | 2017-07-21 13:01:00 +0200 |
|---|---|---|
| committer | codicodi <rob.ceglinski@gmail.com> | 2017-07-21 13:01:00 +0200 |
| commit | dc4998bf702b14f51f36ab40d85d3b090d5bfa9c (patch) | |
| tree | 2c736c694c2aeacf839ae58226b2b90cedac55bd /ports/sdl2-image | |
| parent | a42da34a07187063da297b422a95dbb2d7bd064a (diff) | |
| download | vcpkg-dc4998bf702b14f51f36ab40d85d3b090d5bfa9c.tar.gz vcpkg-dc4998bf702b14f51f36ab40d85d3b090d5bfa9c.zip | |
[sdl2] Prevent exports in static build
Diffstat (limited to 'ports/sdl2-image')
| -rw-r--r-- | ports/sdl2-image/CMakeLists.txt | 92 | ||||
| -rw-r--r-- | ports/sdl2-image/CONTROL | 2 | ||||
| -rw-r--r-- | ports/sdl2-image/portfile.cmake | 1 |
3 files changed, 49 insertions, 46 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 |
