early-access version 2853
This commit is contained in:
12
externals/vcpkg/ports/sdl2-image/0001-sdl2-image-potentially-uninitialized_local-pointer-variable-start.patch
vendored
Executable file
12
externals/vcpkg/ports/sdl2-image/0001-sdl2-image-potentially-uninitialized_local-pointer-variable-start.patch
vendored
Executable file
@@ -0,0 +1,12 @@
|
||||
--- a/nanosvg.h
|
||||
+++ b/nanosvg.h
|
||||
@@ -2778,7 +2778,7 @@ static void nsvg__content(void* ud, const char* s)
|
||||
if (p->styleFlag) {
|
||||
|
||||
int state = 0;
|
||||
- const char* start;
|
||||
+ const char* start = 0;
|
||||
while (*s) {
|
||||
char c = *s;
|
||||
if (nsvg__isspace(c) || c == '{') {
|
||||
|
130
externals/vcpkg/ports/sdl2-image/CMakeLists.txt
vendored
Executable file
130
externals/vcpkg/ports/sdl2-image/CMakeLists.txt
vendored
Executable file
@@ -0,0 +1,130 @@
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
project(SDL2_image C)
|
||||
|
||||
### configuration ###
|
||||
|
||||
# enable all file formats which are supported natively
|
||||
set(SUPPORTED_FORMATS BMP GIF LBM PCX PNM TGA XPM XCF XV SVG)
|
||||
|
||||
# enable all file formats which are supported through external dependencies
|
||||
option(USE_WEBP "Enable support for WebP format" OFF)
|
||||
option(USE_PNG "Enable support for PNG format" OFF)
|
||||
option(USE_JPEG "Enable support for JPEG format" OFF)
|
||||
option(USE_TIFF "Enable support for TIFF format" OFF)
|
||||
|
||||
### implementation ###
|
||||
|
||||
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_svg.c
|
||||
IMG_tga.c
|
||||
IMG_tif.c
|
||||
IMG_webp.c
|
||||
IMG_xcf.c
|
||||
IMG_xpm.c
|
||||
IMG_xv.c
|
||||
IMG_xxx.c
|
||||
IMG_WIC.c
|
||||
version.rc
|
||||
)
|
||||
|
||||
if (APPLE)
|
||||
target_sources(SDL2_image PRIVATE
|
||||
IMG_ImageIO.m
|
||||
)
|
||||
target_compile_options(SDL2_image BEFORE PRIVATE
|
||||
"-x" "objective-c"
|
||||
)
|
||||
endif()
|
||||
|
||||
set_target_properties(SDL2_image PROPERTIES DEFINE_SYMBOL DLL_EXPORT)
|
||||
|
||||
foreach(FORMAT ${SUPPORTED_FORMATS})
|
||||
add_definitions(-DLOAD_${FORMAT})
|
||||
endforeach(FORMAT)
|
||||
|
||||
# SDL
|
||||
find_path(SDL_INCLUDE_DIR SDL2/SDL.h)
|
||||
find_package(SDL2 CONFIG REQUIRED)
|
||||
|
||||
include_directories(${SDL_INCLUDE_DIR})
|
||||
include_directories(${SDL_INCLUDE_DIR}/SDL2)
|
||||
include_directories(${CMAKE_SOURCE_DIR})
|
||||
|
||||
target_link_libraries(SDL2_image SDL2::SDL2)
|
||||
|
||||
# external dependencies
|
||||
if(USE_WEBP)
|
||||
find_package(WebP CONFIG REQUIRED)
|
||||
add_definitions(-DLOAD_WEBP)
|
||||
target_link_libraries(SDL2_image PRIVATE WebP::webp)
|
||||
endif()
|
||||
|
||||
if(USE_PNG)
|
||||
find_package(PNG REQUIRED)
|
||||
add_definitions(-DLOAD_PNG)
|
||||
target_link_libraries(SDL2_image PRIVATE PNG::PNG)
|
||||
endif()
|
||||
|
||||
if(USE_JPEG)
|
||||
find_package(JPEG REQUIRED)
|
||||
add_definitions(-DLOAD_JPG)
|
||||
target_link_libraries(SDL2_image PRIVATE ${JPEG_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(USE_TIFF)
|
||||
find_package(TIFF REQUIRED)
|
||||
add_definitions(-DLOAD_TIF)
|
||||
target_link_libraries(SDL2_image PRIVATE TIFF::TIFF)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
install(TARGETS SDL2_image
|
||||
EXPORT SDL2_image
|
||||
RUNTIME DESTINATION bin
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib)
|
||||
|
||||
install(FILES SDL_image.h DESTINATION include/SDL2 CONFIGURATIONS Release)
|
||||
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/sdl2-image-config.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/sdl2-image-config.cmake" @ONLY
|
||||
INSTALL_DESTINATION "share/sdl2-image")
|
||||
|
||||
set(prefix "")
|
||||
set(exec_prefix [[${prefix}]])
|
||||
set(libdir [[${prefix}/lib]])
|
||||
set(includedir [[${prefix}/include]])
|
||||
set(PACKAGE "SDL2_image")
|
||||
file(READ "SDL_image.h" header_contents)
|
||||
# #define SDL_IMAGE_MAJOR_VERSION 2
|
||||
# #define SDL_IMAGE_MINOR_VERSION 0
|
||||
# #define SDL_IMAGE_PATCHLEVEL 5
|
||||
string(REGEX MATCH "define *SDL_IMAGE_MAJOR_VERSION *([0-9]+)" _ "${header_contents}")
|
||||
set(VERSION ${CMAKE_MATCH_1})
|
||||
string(REGEX MATCH "define *SDL_IMAGE_MINOR_VERSION *([0-9]+)" _ "${header_contents}")
|
||||
string(APPEND VERSION ".${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define *SDL_IMAGE_PATCHLEVEL *([0-9]+)" _ "${header_contents}")
|
||||
string(APPEND VERSION ".${CMAKE_MATCH_1}")
|
||||
set(SDL_VERSION 0.0)
|
||||
configure_file(SDL2_image.pc.in "${CMAKE_CURRENT_BINARY_DIR}/SDL2_image.pc" @ONLY)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/SDL2_image.pc DESTINATION lib/pkgconfig)
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/sdl2-image-config.cmake DESTINATION share/sdl2-image)
|
||||
|
||||
install(EXPORT SDL2_image
|
||||
DESTINATION share/sdl2-image/
|
||||
FILE sdl2-image-targets.cmake
|
||||
NAMESPACE SDL2::
|
||||
)
|
43
externals/vcpkg/ports/sdl2-image/portfile.cmake
vendored
Executable file
43
externals/vcpkg/ports/sdl2-image/portfile.cmake
vendored
Executable file
@@ -0,0 +1,43 @@
|
||||
set(SDL2_IMAGE_VERSION "2.0.5")
|
||||
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "https://www.libsdl.org/projects/SDL_image/release/SDL2_image-${SDL2_IMAGE_VERSION}.zip"
|
||||
FILENAME "SDL2_image-${SDL2_IMAGE_VERSION}.zip"
|
||||
SHA512 c10e28a0d50fb7a6c985ffe8904370ab4faeb9bbed6f2ffbc81536422e8f8bb66eddbf69b12423082216c2bcfcb617cba4c5970f63fe75bfacccd9f99f02a6a2
|
||||
)
|
||||
|
||||
vcpkg_extract_source_archive_ex(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
ARCHIVE ${ARCHIVE}
|
||||
REF ${SDL2_IMAGE_VERSION}
|
||||
PATCHES
|
||||
0001-sdl2-image-potentially-uninitialized_local-pointer-variable-start.patch
|
||||
)
|
||||
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/sdl2-image-config.cmake.in" DESTINATION "${SOURCE_PATH}")
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
libjpeg-turbo USE_JPEG
|
||||
tiff USE_TIFF
|
||||
libwebp USE_WEBP
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-DUSE_PNG=ON
|
||||
${FEATURE_OPTIONS}
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
vcpkg_cmake_config_fixup()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL "${SOURCE_PATH}/COPYING.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
13
externals/vcpkg/ports/sdl2-image/sdl2-image-config.cmake.in
vendored
Executable file
13
externals/vcpkg/ports/sdl2-image/sdl2-image-config.cmake.in
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
find_dependency(SDL2 CONFIG)
|
||||
|
||||
if(@USE_WEBP@)
|
||||
find_dependency(WebP CONFIG)
|
||||
endif()
|
||||
|
||||
if (@USE_PNG@)
|
||||
find_dependency(PNG)
|
||||
endif()
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/sdl2-image-targets.cmake")
|
61
externals/vcpkg/ports/sdl2-image/vcpkg.json
vendored
Executable file
61
externals/vcpkg/ports/sdl2-image/vcpkg.json
vendored
Executable file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"name": "sdl2-image",
|
||||
"version": "2.0.5",
|
||||
"port-version": 6,
|
||||
"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",
|
||||
"homepage": "https://www.libsdl.org/projects/SDL_image",
|
||||
"license": "Zlib",
|
||||
"dependencies": [
|
||||
"libpng",
|
||||
"sdl2",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"features": {
|
||||
"libjpeg-turbo": {
|
||||
"description": "Support for JPEG image format",
|
||||
"dependencies": [
|
||||
"libjpeg-turbo",
|
||||
{
|
||||
"name": "sdl2",
|
||||
"features": [
|
||||
"x11"
|
||||
],
|
||||
"platform": "!windows"
|
||||
}
|
||||
]
|
||||
},
|
||||
"libwebp": {
|
||||
"description": "Support for WEBP image format.",
|
||||
"dependencies": [
|
||||
"libwebp",
|
||||
{
|
||||
"name": "sdl2",
|
||||
"features": [
|
||||
"x11"
|
||||
],
|
||||
"platform": "!windows"
|
||||
}
|
||||
]
|
||||
},
|
||||
"tiff": {
|
||||
"description": "Support for TIFF image format",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "sdl2",
|
||||
"features": [
|
||||
"x11"
|
||||
],
|
||||
"platform": "!windows"
|
||||
},
|
||||
"tiff"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user