aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/directxmath
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/directxmath
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/directxmath')
-rw-r--r--vcpkg/ports/directxmath/Linux-SHMath-SAL.patch21
-rw-r--r--vcpkg/ports/directxmath/MinGW-fix.patch15
-rw-r--r--vcpkg/ports/directxmath/portfile.cmake75
-rw-r--r--vcpkg/ports/directxmath/shmathusage3
-rw-r--r--vcpkg/ports/directxmath/usage4
-rw-r--r--vcpkg/ports/directxmath/vcpkg.json38
6 files changed, 156 insertions, 0 deletions
diff --git a/vcpkg/ports/directxmath/Linux-SHMath-SAL.patch b/vcpkg/ports/directxmath/Linux-SHMath-SAL.patch
new file mode 100644
index 0000000..f6352d9
--- /dev/null
+++ b/vcpkg/ports/directxmath/Linux-SHMath-SAL.patch
@@ -0,0 +1,21 @@
+diff --git a/SHMath/CMakeLists.txt b/SHMath/CMakeLists.txt
+index 8a21ee7..5d9ea30 100644
+--- a/SHMath/CMakeLists.txt
++++ b/SHMath/CMakeLists.txt
+@@ -217,3 +217,13 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
+ target_compile_options(${PROJECT_NAME} PRIVATE $<$<VERSION_GREATER_EQUAL:${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION},10.0.22000>:/Zc:templateScope>)
+ endif()
+ endif()
++
++if(NOT WIN32)
++ file(DOWNLOAD
++ https://raw.githubusercontent.com/dotnet/runtime/v9.0.2/src/coreclr/pal/inc/rt/sal.h
++ "${CMAKE_CURRENT_BINARY_DIR}/sal/sal.h"
++ EXPECTED_HASH SHA512=8085f67bfa4ce01ae89461cadf72454a9552fde3f08b2dcc3de36b9830e29ce7a6192800f8a5cb2a66af9637be0017e85719826a4cfdade508ae97f319e0ee8e
++ )
++
++ target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/sal")
++endif()
+--
+2.49.0.windows.1
+
diff --git a/vcpkg/ports/directxmath/MinGW-fix.patch b/vcpkg/ports/directxmath/MinGW-fix.patch
new file mode 100644
index 0000000..3f64527
--- /dev/null
+++ b/vcpkg/ports/directxmath/MinGW-fix.patch
@@ -0,0 +1,15 @@
+diff --git a/SHMath/CMakeLists.txt b/SHMath/CMakeLists.txt
+index dc5cb6d..aa6d4a0 100644
+--- a/SHMath/CMakeLists.txt
++++ b/SHMath/CMakeLists.txt
+@@ -73,7 +73,7 @@ target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_11)
+
+ target_link_libraries(${PROJECT_NAME} PRIVATE DirectXMath)
+
+-if(MINGW)
++if(MINGW AND BUILD_DX12)
+ find_package(directx-headers CONFIG REQUIRED)
+ target_link_libraries(${PROJECT_NAME} PUBLIC Microsoft::DirectX-Headers)
+ target_compile_definitions(${PROJECT_NAME} PUBLIC USING_DIRECTX_HEADERS)
+--
+2.49.0.windows.1
diff --git a/vcpkg/ports/directxmath/portfile.cmake b/vcpkg/ports/directxmath/portfile.cmake
new file mode 100644
index 0000000..c0018de
--- /dev/null
+++ b/vcpkg/ports/directxmath/portfile.cmake
@@ -0,0 +1,75 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO Microsoft/DirectXMath
+ REF apr2025
+ SHA512 c7d3b107180b269c5c4e823fa51d96a316dc35cace3cb13f030022d9096c9465e8a770559419176692b047574fd67c96d8527abd8817998264a149eee0b88c9d
+ HEAD_REF main
+ PATCHES
+ MinGW-fix.patch
+ Linux-SHMath-SAL.patch
+)
+
+vcpkg_check_features(
+ OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ xdsp BUILD_XDSP
+ dx11 BUILD_DX11
+ dx12 BUILD_DX12
+)
+
+set(EXTRA_OPTIONS "")
+
+if(("dx11" IN_LIST FEATURES) OR ("dx12" IN_LIST FEATURES))
+ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+ list(APPEND EXTRA_OPTIONS -DBUILD_SHMATH=ON)
+endif()
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS ${FEATURE_OPTIONS} ${EXTRA_OPTIONS}
+ MAYBE_UNUSED_VARIABLES BUILD_DX11 BUILD_DX12
+)
+
+vcpkg_cmake_install()
+
+file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/DirectXMath.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/share/pkgconfig")
+
+vcpkg_fixup_pkgconfig()
+vcpkg_cmake_config_fixup(CONFIG_PATH share/directxmath)
+
+if(("dx11" IN_LIST FEATURES) OR ("dx12" IN_LIST FEATURES))
+ vcpkg_cmake_config_fixup(CONFIG_PATH share/directxsh)
+endif()
+
+if("xdsp" IN_LIST FEATURES)
+ vcpkg_cmake_config_fixup(CONFIG_PATH share/xdsp)
+endif()
+
+if(NOT VCPKG_TARGET_IS_WINDOWS)
+ vcpkg_download_distfile(
+ SAL_HEADER
+ URLS "https://raw.githubusercontent.com/dotnet/runtime/v9.0.2/src/coreclr/pal/inc/rt/sal.h"
+ FILENAME "sal.h"
+ SHA512 8085f67bfa4ce01ae89461cadf72454a9552fde3f08b2dcc3de36b9830e29ce7a6192800f8a5cb2a66af9637be0017e85719826a4cfdade508ae97f319e0ee8e
+ )
+
+ file(INSTALL
+ ${DOWNLOADS}/sal.h
+ DESTINATION ${CURRENT_PACKAGES_DIR}/include)
+endif()
+
+if(("dx11" IN_LIST FEATURES) OR ("dx12" IN_LIST FEATURES))
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+else()
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
+endif()
+
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+
+if(("dx11" IN_LIST FEATURES) OR ("dx12" IN_LIST FEATURES))
+ file(READ "${CMAKE_CURRENT_LIST_DIR}/shmathusage" USAGE_CONTENT)
+ file(APPEND "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" ${USAGE_CONTENT})
+endif()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/directxmath/shmathusage b/vcpkg/ports/directxmath/shmathusage
new file mode 100644
index 0000000..20a75cb
--- /dev/null
+++ b/vcpkg/ports/directxmath/shmathusage
@@ -0,0 +1,3 @@
+
+ find_package(directxmath CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE Microsoft::DirectXSH)
diff --git a/vcpkg/ports/directxmath/usage b/vcpkg/ports/directxmath/usage
new file mode 100644
index 0000000..6e179fe
--- /dev/null
+++ b/vcpkg/ports/directxmath/usage
@@ -0,0 +1,4 @@
+The DirectXMath package provides CMake targets:
+
+ find_package(directxmath CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE Microsoft::DirectXMath)
diff --git a/vcpkg/ports/directxmath/vcpkg.json b/vcpkg/ports/directxmath/vcpkg.json
new file mode 100644
index 0000000..db627e0
--- /dev/null
+++ b/vcpkg/ports/directxmath/vcpkg.json
@@ -0,0 +1,38 @@
+{
+ "name": "directxmath",
+ "version-date": "2025-04-03",
+ "description": "DirectXMath SIMD C++ math library",
+ "homepage": "https://github.com/Microsoft/DirectXMath",
+ "documentation": "https://docs.microsoft.com/windows/win32/dxmath/directxmath-portal",
+ "license": "MIT",
+ "supports": "!arm32",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "dx11": {
+ "description": "C++ Spherical Harmonics Math Library for DirectX 11",
+ "supports": "windows & !xbox"
+ },
+ "dx12": {
+ "description": "C++ Spherical Harmonics Math Library for DirectX 12",
+ "supports": "(windows & !arm32) | linux",
+ "dependencies": [
+ {
+ "name": "directx-headers",
+ "platform": "windows & !xbox"
+ }
+ ]
+ },
+ "xdsp": {
+ "description": "XDSP Digital Signal Processing (DSP) for DirectXMath"
+ }
+ }
+}