mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-27 04:41:39 +00:00
Initial Linux attempt.
This commit is contained in:
parent
27eab0af66
commit
d29049dcb1
5 changed files with 97 additions and 37 deletions
|
|
@ -45,6 +45,38 @@
|
|||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "linux-debug",
|
||||
"displayName": "Linux Debug",
|
||||
"description": "Target the Windows Subsystem for Linux (WSL) or a remote Linux system.",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/out/build/${presetName}",
|
||||
"installDir": "${sourceDir}/out/install/${presetName}",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"CMAKE_TOOLCHAIN_FILE": {
|
||||
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
|
||||
"type": "FILEPATH"
|
||||
},
|
||||
"VCPKG_TARGET_TRIPLET": {
|
||||
"value": "x64-linux",
|
||||
"type": "STRING"
|
||||
}
|
||||
},
|
||||
"environment": {
|
||||
"VCPKG_ROOT": "~/vcpkg"
|
||||
},
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Linux"
|
||||
},
|
||||
"vendor": {
|
||||
"microsoft.com/VisualStudioRemoteSettings/CMake/2.0": {
|
||||
"remoteSourceRootDir": "$env{HOME}/.vs/$ms{projectDirName}"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,10 +90,15 @@ set(SWA_GPU_CXX_SOURCES
|
|||
"gpu/imgui/imgui_common.cpp"
|
||||
"gpu/imgui/imgui_font_builder.cpp"
|
||||
"gpu/imgui/imgui_snapshot.cpp"
|
||||
"gpu/rhi/plume_d3d12.cpp"
|
||||
"gpu/rhi/plume_vulkan.cpp"
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
list(APPEND SWA_GPU_CXX_SOURCES
|
||||
"gpu/rhi/plume_d3d12.cpp"
|
||||
)
|
||||
endif()
|
||||
|
||||
set(SWA_APU_CXX_SOURCES
|
||||
"apu/audio.cpp"
|
||||
"apu/embedded_player.cpp"
|
||||
|
|
@ -204,9 +209,12 @@ endif()
|
|||
|
||||
set_target_properties(UnleashedRecomp PROPERTIES OUTPUT_NAME ${TARGET_NAME})
|
||||
|
||||
find_package(directx-headers CONFIG REQUIRED)
|
||||
find_package(directx12-agility CONFIG REQUIRED)
|
||||
find_package(d3d12-memory-allocator CONFIG REQUIRED)
|
||||
if (WIN32)
|
||||
find_package(directx-headers CONFIG REQUIRED)
|
||||
find_package(directx12-agility CONFIG REQUIRED)
|
||||
find_package(d3d12-memory-allocator CONFIG REQUIRED)
|
||||
endif()
|
||||
|
||||
find_package(SDL2 CONFIG REQUIRED)
|
||||
find_package(unordered_dense CONFIG REQUIRED)
|
||||
find_package(VulkanHeaders CONFIG)
|
||||
|
|
@ -225,39 +233,44 @@ find_package(unofficial-tiny-aes-c CONFIG REQUIRED)
|
|||
find_package(nfd CONFIG REQUIRED)
|
||||
find_package(Vorbis CONFIG REQUIRED)
|
||||
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/D3D12)
|
||||
add_custom_command(TARGET UnleashedRecomp POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_PROPERTY:Microsoft::DirectX12-Core,IMPORTED_LOCATION_RELEASE> ${CMAKE_CURRENT_BINARY_DIR}/D3D12
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_PROPERTY:Microsoft::DirectX12-Layers,IMPORTED_LOCATION_DEBUG> ${CMAKE_CURRENT_BINARY_DIR}/D3D12
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
if (WIN32)
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/D3D12)
|
||||
add_custom_command(TARGET UnleashedRecomp POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_PROPERTY:Microsoft::DirectX12-Core,IMPORTED_LOCATION_RELEASE> ${CMAKE_CURRENT_BINARY_DIR}/D3D12
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_PROPERTY:Microsoft::DirectX12-Layers,IMPORTED_LOCATION_DEBUG> ${CMAKE_CURRENT_BINARY_DIR}/D3D12
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
|
||||
file(COPY ${PACKAGE_PREFIX_DIR}/bin/dxil.dll DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
file(COPY ${PACKAGE_PREFIX_DIR}/bin/dxil.dll DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
target_link_libraries(UnleashedRecomp PRIVATE
|
||||
Microsoft::DirectX-Headers
|
||||
Microsoft::DirectX-Guids
|
||||
Microsoft::DirectX12-Agility
|
||||
Microsoft::DirectXShaderCompiler
|
||||
unofficial::D3D12MemoryAllocator
|
||||
comctl32
|
||||
dxgi
|
||||
ntdll
|
||||
winmm
|
||||
Synchronization
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(UnleashedRecomp PRIVATE
|
||||
Microsoft::DirectX-Headers
|
||||
Microsoft::DirectX-Guids
|
||||
Microsoft::DirectX12-Agility
|
||||
Microsoft::DirectXShaderCompiler
|
||||
comctl32
|
||||
dxgi
|
||||
Vulkan::Headers
|
||||
volk::volk
|
||||
volk::volk_headers
|
||||
GPUOpen::VulkanMemoryAllocator
|
||||
ntdll
|
||||
o1heap
|
||||
PowerUtils
|
||||
SDL2::SDL2-static
|
||||
UnleashedRecompLib
|
||||
unofficial::D3D12MemoryAllocator
|
||||
unordered_dense::unordered_dense
|
||||
winmm
|
||||
xxHash::xxhash
|
||||
PkgConfig::tomlplusplus
|
||||
zstd::libzstd_static
|
||||
unofficial::concurrentqueue::concurrentqueue
|
||||
Synchronization
|
||||
imgui::imgui
|
||||
magic_enum::magic_enum
|
||||
unofficial::tiny-aes-c::tiny-aes-c
|
||||
|
|
@ -283,17 +296,20 @@ target_precompile_headers(UnleashedRecomp PUBLIC ${SWA_PRECOMPILED_HEADERS})
|
|||
function(compile_shader FILE_PATH TARGET_NAME)
|
||||
set(FILE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/gpu/shader/${FILE_PATH}.hlsl)
|
||||
cmake_path(GET FILE_PATH STEM VARIABLE_NAME)
|
||||
add_custom_command(
|
||||
OUTPUT ${FILE_PATH}.dxil.h
|
||||
COMMAND ${DIRECTX_DXC_TOOL} -T ${TARGET_NAME} -HV 2021 -all-resources-bound -Wno-ignored-attributes -Fh ${FILE_PATH}.dxil.h ${FILE_PATH} -Vn g_${VARIABLE_NAME}_dxil
|
||||
DEPENDS ${FILE_PATH}
|
||||
)
|
||||
if (WIN32)
|
||||
add_custom_command(
|
||||
OUTPUT ${FILE_PATH}.dxil.h
|
||||
COMMAND ${DIRECTX_DXC_TOOL} -T ${TARGET_NAME} -HV 2021 -all-resources-bound -Wno-ignored-attributes -Fh ${FILE_PATH}.dxil.h ${FILE_PATH} -Vn g_${VARIABLE_NAME}_dxil
|
||||
DEPENDS ${FILE_PATH}
|
||||
)
|
||||
target_sources(UnleashedRecomp PRIVATE ${FILE_PATH}.dxil.h)
|
||||
endif()
|
||||
add_custom_command(
|
||||
OUTPUT ${FILE_PATH}.spirv.h
|
||||
COMMAND ${DIRECTX_DXC_TOOL} -T ${TARGET_NAME} -HV 2021 -all-resources-bound -spirv -fvk-use-dx-layout ${ARGN} -Fh ${FILE_PATH}.spirv.h ${FILE_PATH} -Vn g_${VARIABLE_NAME}_spirv
|
||||
DEPENDS ${FILE_PATH}
|
||||
)
|
||||
target_sources(UnleashedRecomp PRIVATE ${FILE_PATH}.dxil.h ${FILE_PATH}.spirv.h)
|
||||
target_sources(UnleashedRecomp PRIVATE ${FILE_PATH}.spirv.h)
|
||||
endfunction()
|
||||
|
||||
function(compile_vertex_shader FILE_PATH)
|
||||
|
|
|
|||
2
thirdparty/ShaderRecomp
vendored
2
thirdparty/ShaderRecomp
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit f936ed2212d8291439003eb0c0d8edc0ecafd24d
|
||||
Subproject commit 5eaf542426992cec9b98ab14a1c46c85d4ad3120
|
||||
2
thirdparty/fshasher/CMakeLists.txt
vendored
2
thirdparty/fshasher/CMakeLists.txt
vendored
|
|
@ -2,6 +2,6 @@ project("fshasher")
|
|||
|
||||
add_executable(fshasher "fshasher.cpp")
|
||||
|
||||
find_package(xxhash CONFIG REQUIRED)
|
||||
find_package(xxHash CONFIG REQUIRED)
|
||||
|
||||
target_link_libraries(fshasher PRIVATE xxHash::xxhash)
|
||||
|
|
|
|||
28
vcpkg.json
28
vcpkg.json
|
|
@ -1,9 +1,26 @@
|
|||
{
|
||||
"builtin-baseline": "e63bd09dc0b7204467705c1c7c71d0e2a3f8860b",
|
||||
"dependencies": [
|
||||
"directx-headers",
|
||||
"directx12-agility",
|
||||
"d3d12-memory-allocator",
|
||||
{
|
||||
"name": "directx-headers",
|
||||
"platform": "windows"
|
||||
},
|
||||
{
|
||||
"name": "directx12-agility",
|
||||
"platform": "windows"
|
||||
},
|
||||
{
|
||||
"name": "d3d12-memory-allocator",
|
||||
"platform": "windows"
|
||||
},
|
||||
{
|
||||
"name": "pkgconf",
|
||||
"platform": "windows"
|
||||
},
|
||||
{
|
||||
"name": "imgui",
|
||||
"features": [ "sdl2-binding" ]
|
||||
},
|
||||
"directx-dxc",
|
||||
"sdl2",
|
||||
"unordered-dense",
|
||||
|
|
@ -11,16 +28,11 @@
|
|||
"vulkan-headers",
|
||||
"vulkan-memory-allocator",
|
||||
"xxhash",
|
||||
"pkgconf",
|
||||
"tomlplusplus",
|
||||
"zstd",
|
||||
"stb",
|
||||
"concurrentqueue",
|
||||
"tiny-aes-c",
|
||||
{
|
||||
"name": "imgui",
|
||||
"features": [ "sdl2-binding" ]
|
||||
},
|
||||
"magic-enum",
|
||||
"nativefiledialog-extended",
|
||||
"freetype",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue