Skip to content

Commit

Permalink
Don't link vcpkg for x86 builds and make it an optional feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
crud89 committed Jul 4, 2024
1 parent e048501 commit 69191d0
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 54 deletions.
2 changes: 1 addition & 1 deletion docs/release-logs/0.4.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

**❎ DirectX 12:**

- Use official PIX event runtime for DX12 debug builds. ([See PR #82](https://github.com/crud89/LiteFX/pull/82) and ([PR #133](https://github.com/crud89/LiteFX/pull/133))
- Link PIX event runtime for DX12 x64 builds by default. ([See PR #82](https://github.com/crud89/LiteFX/pull/82) and ([PR #133](https://github.com/crud89/LiteFX/pull/133))
- Switch D3D12 runtime to DirectX Agility SDK. ([See PR #95](https://github.com/crud89/LiteFX/pull/95))
- Add support for enhanced barriers. ([See PR #97](https://github.com/crud89/LiteFX/pull/97))
- Raise minimum required feature level to 12.1. ([See PR #122](https://github.com/crud89/LiteFX/pull/122))
Expand Down
14 changes: 12 additions & 2 deletions src/Backends/DirectX12/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ MESSAGE(STATUS "Initializing: ${PROJECT_NAME}...")
FIND_PACKAGE(directx-headers CONFIG REQUIRED)
FIND_PACKAGE(directx-agility-sdk CONFIG REQUIRED)
FIND_PACKAGE(d3d12-memory-allocator CONFIG REQUIRED)
FIND_PACKAGE(WinPixEventRuntime CONFIG REQUIRED)
FIND_PACKAGE(directx-dxc CONFIG REQUIRED)

# Collect header & source files.
Expand Down Expand Up @@ -89,9 +88,20 @@ TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME}
# Link project dependencies.
TARGET_LINK_LIBRARIES(${PROJECT_NAME}
PUBLIC LiteFX.Core LiteFX.Math LiteFX.Rendering LiteFX.AppModel Microsoft::DirectX-Headers Microsoft::DirectX-Guids dxgi Microsoft::DirectXAgilitySDK Microsoft::DirectXShaderCompiler Microsoft::DXIL
PRIVATE unofficial::d3d12-memory-allocator Microsoft::WinPixEventRuntime
PRIVATE unofficial::d3d12-memory-allocator
)

# Link PIX runtime, if available.
IF("pix-support" IN_LIST VCPKG_MANIFEST_FEATURES)
FIND_PACKAGE(WinPixEventRuntime CONFIG)

IF(WinPixEventRuntime_FOUND)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PRIVATE Microsoft::WinPixEventRuntime)
ELSE()
MESSAGE(WARNING "PIX runtime was not found and will not be linked.")
ENDIF(WinPixEventRuntime_FOUND)
ENDIF("pix-support" IN_LIST VCPKG_MANIFEST_FEATURES)

# Add shader modules.
ADD_SHADER_LIBRARY(${PROJECT_NAME}.Shaders SOURCE_FILE "shader_resources.hpp" NAMESPACE "LiteFX::Backends::DirectX12::Shaders")
ADD_SHADER_MODULE(${PROJECT_NAME}.Blit SOURCE "shaders/blit.hlsl" LANGUAGE HLSL TYPE COMPUTE COMPILE_AS DXIL SHADER_MODEL ${LITEFX_BUILD_HLSL_SHADER_MODEL} COMPILER DXC LIBRARY ${PROJECT_NAME}.Shaders)
Expand Down
59 changes: 12 additions & 47 deletions src/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,9 @@
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "windows-x64-test",
"inherits": "windows",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"LITEFX_BUILD_TESTS": "ON"
"VCPKG_MANIFEST_FEATURES": "pix-support"
}
},
{
Expand All @@ -53,18 +42,21 @@
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
"CMAKE_BUILD_TYPE": "Release",
"VCPKG_MANIFEST_FEATURES": "pix-support"
}
},
{
"name": "windows-x64-publish",
"name": "windows-x64-test",
"inherits": "windows",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
"CMAKE_BUILD_TYPE": "Debug",
"LITEFX_BUILD_TESTS": "ON",
"VCPKG_MANIFEST_FEATURES": "pix-support"
}
},
{
Expand All @@ -78,18 +70,6 @@
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "windows-x86-test",
"inherits": "windows",
"architecture": {
"value": "x86",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"LITEFX_BUILD_TESTS": "ON"
}
},
{
"name": "windows-x86-release",
"inherits": "windows",
Expand All @@ -102,41 +82,26 @@
}
},
{
"name": "windows-x86-publish",
"name": "windows-x86-test",
"inherits": "windows",
"architecture": {
"value": "x86",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
"CMAKE_BUILD_TYPE": "Debug",
"LITEFX_BUILD_TESTS": "ON"
}
}
],
"buildPresets": [
{
"name": "windows-x64-release",
"configurePreset": "windows-x64-release"
},
{
"name": "windows-x64-debug",
"configurePreset": "windows-x64-debug"
},
{
"name": "windows-x86-release",
"configurePreset": "windows-x86-release"
},
{
"name": "windows-x86-debug",
"configurePreset": "windows-x86-debug"
},
{
"name": "windows-x86-publish",
"configurePreset": "windows-x86-publish"
"configurePreset": "windows-x86-release"
},
{
"name": "windows-x64-publish",
"configurePreset": "windows-x64-publish"
"configurePreset": "windows-x64-release"
}
],
"testPresets": [
Expand Down
3 changes: 1 addition & 2 deletions src/Modules/overlay-ports/winpixeventruntime/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
"homepage": "https://devblogs.microsoft.com/pix/winpixeventruntime/",
"documentation": "https://devblogs.microsoft.com/pix/winpixeventruntime/",
"license": "MIT",
"supports": "windows & !uwp",
"supports": "windows & x64 & !uwp",
"dependencies": [
"directx-headers",
{
"name": "vcpkg-cmake",
"host": true
Expand Down
10 changes: 8 additions & 2 deletions src/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@
"spirv-reflect",
"vulkan-memory-allocator",
"d3d12-memory-allocator",
"winpixeventruntime",
"directx-agility-sdk",
"directx-dxc"
]
],
"features": {
"pix-support": {
"description": "Adds support for PIX runtime in the DirectX 12 backend.",
"supports": "windows & x64",
"dependencies": [ "winpixeventruntime" ]
}
}
}

0 comments on commit 69191d0

Please sign in to comment.