mirror of
https://github.com/hedge-dev/XenosRecomp.git
synced 2025-10-30 07:12:17 +00:00
Switch to renderbag dxc-bin for shader compiler. (#6)
This commit is contained in:
parent
db602accf4
commit
ce67db864b
6 changed files with 21 additions and 13 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
|
@ -10,3 +10,6 @@
|
||||||
[submodule "thirdparty/fmt"]
|
[submodule "thirdparty/fmt"]
|
||||||
path = thirdparty/fmt
|
path = thirdparty/fmt
|
||||||
url = https://github.com/fmtlib/fmt.git
|
url = https://github.com/fmtlib/fmt.git
|
||||||
|
[submodule "thirdparty/dxc-bin"]
|
||||||
|
path = thirdparty/dxc-bin
|
||||||
|
url = https://github.com/renderbag/dxc-bin.git
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
cmake_minimum_required(VERSION 3.20)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
include($ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake)
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
|
||||||
project("XenosRecomp-ALL")
|
project("XenosRecomp-ALL")
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,8 @@ add_executable(XenosRecomp
|
||||||
shader_recompiler.h
|
shader_recompiler.h
|
||||||
"${SMOLV_SOURCE_DIR}/smolv.cpp")
|
"${SMOLV_SOURCE_DIR}/smolv.cpp")
|
||||||
|
|
||||||
find_package(directx-dxc CONFIG REQUIRED)
|
|
||||||
|
|
||||||
target_link_libraries(XenosRecomp PRIVATE
|
target_link_libraries(XenosRecomp PRIVATE
|
||||||
Microsoft::DirectXShaderCompiler
|
Microsoft::DirectXShaderCompiler
|
||||||
Microsoft::DXIL
|
|
||||||
xxHash::xxhash
|
xxHash::xxhash
|
||||||
libzstd_static
|
libzstd_static
|
||||||
fmt::fmt)
|
fmt::fmt)
|
||||||
|
|
@ -31,16 +28,26 @@ target_include_directories(XenosRecomp PRIVATE ${SMOLV_SOURCE_DIR})
|
||||||
|
|
||||||
target_precompile_headers(XenosRecomp PRIVATE pch.h)
|
target_precompile_headers(XenosRecomp PRIVATE pch.h)
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
||||||
target_compile_options(XenosRecomp PRIVATE -Wno-switch -Wno-unused-variable -Wno-null-arithmetic -fms-extensions)
|
target_compile_options(XenosRecomp PRIVATE -Wno-switch -Wno-unused-variable -Wno-null-arithmetic -fms-extensions)
|
||||||
|
|
||||||
|
include(CheckCXXSymbolExists)
|
||||||
|
check_cxx_symbol_exists(_LIBCPP_VERSION version LIBCPP)
|
||||||
|
if(LIBCPP)
|
||||||
|
# Allows using std::execution
|
||||||
|
target_compile_options(XenosRecomp PRIVATE -fexperimental-library)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
target_compile_definitions(XenosRecomp PRIVATE _CRT_SECURE_NO_WARNINGS)
|
target_compile_definitions(XenosRecomp PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||||
find_file(DIRECTX_DXIL_LIBRARY "dxil.dll")
|
add_custom_command(TARGET XenosRecomp POST_BUILD
|
||||||
file(COPY ${DIRECTX_DXIL_LIBRARY} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:XenosRecomp> $<TARGET_FILE_DIR:XenosRecomp>
|
||||||
|
COMMAND_EXPAND_LISTS
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (XENOS_RECOMP_DXIL)
|
if (XENOS_RECOMP_DXIL)
|
||||||
target_compile_definitions(XenosRecomp PRIVATE XENOS_RECOMP_DXIL)
|
target_compile_definitions(XenosRecomp PRIVATE XENOS_RECOMP_DXIL)
|
||||||
|
target_link_libraries(XenosRecomp PRIVATE Microsoft::DXIL)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
4
thirdparty/CMakeLists.txt
vendored
4
thirdparty/CMakeLists.txt
vendored
|
|
@ -9,3 +9,7 @@ endif()
|
||||||
if (NOT TARGET libzstd)
|
if (NOT TARGET libzstd)
|
||||||
add_subdirectory("${XENOS_RECOMP_THIRDPARTY_ROOT}/zstd/build/cmake")
|
add_subdirectory("${XENOS_RECOMP_THIRDPARTY_ROOT}/zstd/build/cmake")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (NOT TARGET Microsoft::DirectXShaderCompiler)
|
||||||
|
add_subdirectory("${XENOS_RECOMP_THIRDPARTY_ROOT}/dxc-bin")
|
||||||
|
endif()
|
||||||
|
|
|
||||||
1
thirdparty/dxc-bin
vendored
Submodule
1
thirdparty/dxc-bin
vendored
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 737ac9f51c3d06f0cd1ee7e14dc065bafd52310d
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"builtin-baseline": "b322364f06308bdd24823f9d8f03fe0cc86fd46f",
|
|
||||||
"dependencies": [
|
|
||||||
"directx-dxc"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Loading…
Add table
Reference in a new issue