aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/soil2
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/soil2
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/soil2')
-rw-r--r--vcpkg/ports/soil2/CMakeLists.txt84
-rw-r--r--vcpkg/ports/soil2/Workaround-ICE-in-release.patch20
-rw-r--r--vcpkg/ports/soil2/portfile.cmake25
-rw-r--r--vcpkg/ports/soil2/soil2Config.cmake.in13
-rw-r--r--vcpkg/ports/soil2/vcpkg.json15
5 files changed, 157 insertions, 0 deletions
diff --git a/vcpkg/ports/soil2/CMakeLists.txt b/vcpkg/ports/soil2/CMakeLists.txt
new file mode 100644
index 0000000..ca0b7ca
--- /dev/null
+++ b/vcpkg/ports/soil2/CMakeLists.txt
@@ -0,0 +1,84 @@
+cmake_minimum_required(VERSION 3.9)
+
+# Create the soil2 project
+project("soil2" LANGUAGES C)
+
+find_package(OpenGL)
+
+# Do we want to install the headers?
+option(INSTALL_HEADERS "Install header files" ON)
+
+# Set the install dir
+set(INSTALL_CMAKE_DIR share/soil2)
+
+# Set the source files to compile
+set(SOIL2_SRC
+ "src/SOIL2/image_DXT.c"
+ "src/SOIL2/image_DXT.h"
+ "src/SOIL2/image_helper.c"
+ "src/SOIL2/image_helper.h"
+ "src/SOIL2/jo_jpeg.h"
+ "src/SOIL2/pkm_helper.h"
+ "src/SOIL2/pvr_helper.h"
+ "src/SOIL2/SOIL2.c"
+ "src/SOIL2/SOIL2.h"
+ "src/SOIL2/stbi_DDS.h"
+ "src/SOIL2/stbi_DDS_c.h"
+ "src/SOIL2/stbi_ext.h"
+ "src/SOIL2/stbi_ext_c.h"
+ "src/SOIL2/stbi_pkm.h"
+ "src/SOIL2/stbi_pkm_c.h"
+ "src/SOIL2/stbi_pvr.h"
+ "src/SOIL2/stbi_pvr_c.h"
+ "src/SOIL2/stb_image.h"
+ "src/SOIL2/stb_image_write.h"
+ "src/SOIL2/wfETC.c"
+ "src/SOIL2/wfETC.h"
+)
+
+# Add the library as a static linkage
+add_library(soil2 STATIC ${SOIL2_SRC})
+
+# The include dir
+target_include_directories(soil2 INTERFACE $<INSTALL_INTERFACE:include>)
+
+# link opengl32
+target_link_libraries(soil2 PRIVATE ${OPENGL_gl_LIBRARY})
+
+# If its msvc mute the secure warnings
+if(MSVC)
+ target_compile_definitions(soil2 PRIVATE _CRT_SECURE_NO_WARNINGS)
+endif(MSVC)
+
+if(INSTALL_HEADERS)
+ # Install the library object
+ install(TARGETS soil2 EXPORT soil2Targets
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+ )
+
+ # Install the headers
+ install(FILES "src/SOIL2/SOIL2.h" DESTINATION include/SOIL2/)
+
+ # Export the stuff
+ export(TARGETS soil2 FILE "${PROJECT_BINARY_DIR}/soil2Targets.cmake")
+ export(PACKAGE soil2)
+
+ # Create the soil2Config.cmake and soil2ConfigVersion.cmake
+ configure_file(soil2Config.cmake.in "${PROJECT_BINARY_DIR}/soil2Config.cmake" @ONLY)
+
+ # Install the soil2Config.cmake and soil2ConfigVersion.cmake
+ install(FILES
+ "${PROJECT_BINARY_DIR}/soil2Config.cmake"
+ DESTINATION "${INSTALL_CMAKE_DIR}"
+ )
+
+ # Install the export set for use with the install-tree
+ install(EXPORT soil2Targets DESTINATION "${INSTALL_CMAKE_DIR}")
+else(INSTALL_HEADERS)
+ # Install the library object
+ install(TARGETS soil2 EXPORT soil2
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+ )
+endif(INSTALL_HEADERS)
diff --git a/vcpkg/ports/soil2/Workaround-ICE-in-release.patch b/vcpkg/ports/soil2/Workaround-ICE-in-release.patch
new file mode 100644
index 0000000..3e9e29a
--- /dev/null
+++ b/vcpkg/ports/soil2/Workaround-ICE-in-release.patch
@@ -0,0 +1,20 @@
+diff --git a/src/SOIL2/SOIL2.c b/src/SOIL2/SOIL2.c
+index 3a10885..01bbb23 100644
+--- a/src/SOIL2/SOIL2.c
++++ b/src/SOIL2/SOIL2.c
+@@ -2027,6 +2027,7 @@ const char*
+ return result_string_pointer;
+ }
+
++#pragma optimize("", off)
+ unsigned int SOIL_direct_load_DDS_from_memory(
+ const unsigned char *const buffer,
+ int buffer_length,
+@@ -2409,6 +2410,7 @@ unsigned int SOIL_direct_load_DDS_from_memory(
+ quick_exit:
+ return tex_ID;
+ }
++#pragma optimize("", on)
+
+ unsigned int SOIL_direct_load_DDS(
+ const char *filename,
diff --git a/vcpkg/ports/soil2/portfile.cmake b/vcpkg/ports/soil2/portfile.cmake
new file mode 100644
index 0000000..b8c2237
--- /dev/null
+++ b/vcpkg/ports/soil2/portfile.cmake
@@ -0,0 +1,25 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO SpartanJ/soil2
+ REF ddcb35d13cc4129103de1c1a3cb74b828fe46b4a # 1.3.0
+ SHA512 627c7bf4fddd5afef85ba7634c5ec0e10005c700abc1eb07c6346c1604e430c34aa4c33f6ffecbecb3dc2b04de7b855a3f6d923e94f23621ae0184e706358908
+ HEAD_REF master
+ PATCHES Workaround-ICE-in-release.patch
+)
+
+file(
+ COPY
+ "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt"
+ "${CMAKE_CURRENT_LIST_DIR}/soil2Config.cmake.in"
+ DESTINATION "${SOURCE_PATH}"
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS_DEBUG -DINSTALL_HEADERS=OFF
+)
+
+vcpkg_cmake_install()
+
+# Handle copyright
+file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/vcpkg/ports/soil2/soil2Config.cmake.in b/vcpkg/ports/soil2/soil2Config.cmake.in
new file mode 100644
index 0000000..4d9d8b4
--- /dev/null
+++ b/vcpkg/ports/soil2/soil2Config.cmake.in
@@ -0,0 +1,13 @@
+# - Config file for the soil2 package
+# It defines the following variables
+# SOIL2_INCLUDE_DIRS - include directories for SOIL2
+# SOIL2_LIBRARIES - libraries to link against
+
+# Load targets
+get_filename_component(SOIL2_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+include("${SOIL2_CMAKE_DIR}/soil2Targets.cmake")
+
+# Set properties
+get_target_property(SOIL2_INCLUDE_DIRS soil2 INTERFACE_INCLUDE_DIRECTORIES)
+set(SOIL2_LIBRARIES soil2)
+mark_as_advanced(SOIL2_INCLUDE_DIRS SOIL2_LIBRARIES)
diff --git a/vcpkg/ports/soil2/vcpkg.json b/vcpkg/ports/soil2/vcpkg.json
new file mode 100644
index 0000000..08a5013
--- /dev/null
+++ b/vcpkg/ports/soil2/vcpkg.json
@@ -0,0 +1,15 @@
+{
+ "name": "soil2",
+ "version": "1.3.0",
+ "port-version": 1,
+ "description": "Simple OpenGL Image Library 2",
+ "homepage": "https://github.com/SpartanJ/SOIL2",
+ "license": "MIT-0",
+ "supports": "!uwp & !android",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ }
+ ]
+}