[cmake] force external spirv-tools on apple, fix findpkg logic
Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
parent
9647025881
commit
76918a844f
4 changed files with 27 additions and 40 deletions
|
@ -75,7 +75,9 @@ option(ENABLE_WIFI_SCAN "Enable WiFi scanning" OFF)
|
||||||
option(YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" ${EXT_DEFAULT})
|
option(YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" ${EXT_DEFAULT})
|
||||||
option(YUZU_USE_EXTERNAL_VULKAN_HEADERS "Use Vulkan-Headers from externals" ${EXT_DEFAULT})
|
option(YUZU_USE_EXTERNAL_VULKAN_HEADERS "Use Vulkan-Headers from externals" ${EXT_DEFAULT})
|
||||||
option(YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES "Use Vulkan-Utility-Libraries from externals" ${EXT_DEFAULT})
|
option(YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES "Use Vulkan-Utility-Libraries from externals" ${EXT_DEFAULT})
|
||||||
option(YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS "Use SPIRV-Tools from externals" ${EXT_DEFAULT})
|
|
||||||
|
# I hate Apple with a burning passion
|
||||||
|
CMAKE_DEPENDENT_OPTION(YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS "Use SPIRV-Tools from externals" ${EXT_DEFAULT} "NOT APPLE" ON)
|
||||||
|
|
||||||
option(YUZU_USE_QT_MULTIMEDIA "Use QtMultimedia for Camera" OFF)
|
option(YUZU_USE_QT_MULTIMEDIA "Use QtMultimedia for Camera" OFF)
|
||||||
|
|
||||||
|
@ -587,33 +589,6 @@ endif()
|
||||||
# SimpleIni
|
# SimpleIni
|
||||||
AddJsonPackage(simpleini)
|
AddJsonPackage(simpleini)
|
||||||
|
|
||||||
# Most linux distros don't package cubeb, so enable regardless of cpm settings
|
|
||||||
if(ENABLE_CUBEB)
|
|
||||||
AddJsonPackage(cubeb)
|
|
||||||
|
|
||||||
if (cubeb_ADDED)
|
|
||||||
if (NOT MSVC)
|
|
||||||
if (TARGET speex)
|
|
||||||
target_compile_options(speex PRIVATE -Wno-sign-compare)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set_target_properties(cubeb PROPERTIES COMPILE_OPTIONS "")
|
|
||||||
target_compile_options(cubeb INTERFACE
|
|
||||||
-Wno-implicit-const-int-float-conversion
|
|
||||||
-Wno-shadow
|
|
||||||
-Wno-missing-declarations
|
|
||||||
-Wno-return-type
|
|
||||||
-Wno-uninitialized
|
|
||||||
)
|
|
||||||
else()
|
|
||||||
target_compile_options(cubeb PRIVATE
|
|
||||||
/wd4456
|
|
||||||
/wd4458
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# find SDL2 exports a bunch of variables that are needed, so its easier to do this outside of the YUZU_find_package
|
# find SDL2 exports a bunch of variables that are needed, so its easier to do this outside of the YUZU_find_package
|
||||||
if (ENABLE_SDL2)
|
if (ENABLE_SDL2)
|
||||||
if (YUZU_USE_EXTERNAL_SDL2)
|
if (YUZU_USE_EXTERNAL_SDL2)
|
||||||
|
@ -697,6 +672,8 @@ if (ENABLE_SDL2)
|
||||||
find_package(SDL2)
|
find_package(SDL2)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
find_package(SPIRV-Tools)
|
||||||
|
|
||||||
if (ENABLE_QT)
|
if (ENABLE_QT)
|
||||||
if (YUZU_USE_BUNDLED_QT)
|
if (YUZU_USE_BUNDLED_QT)
|
||||||
download_qt(6.8.3)
|
download_qt(6.8.3)
|
||||||
|
|
29
externals/CMakeLists.txt
vendored
29
externals/CMakeLists.txt
vendored
|
@ -80,9 +80,15 @@ if (ENABLE_LIBUSB AND NOT TARGET libusb::usb)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Sirit
|
# Sirit
|
||||||
# TODO(crueter): spirv-tools doesn't work w/ system
|
|
||||||
set(SPIRV_WERROR OFF)
|
set(SPIRV_WERROR OFF)
|
||||||
AddJsonPackage(spirv-headers)
|
AddPackage(
|
||||||
|
NAME SPIRV-Headers
|
||||||
|
REPO "KhronosGroup/SPIRV-Headers"
|
||||||
|
SHA 4e209d3d7e
|
||||||
|
HASH f48bbe18341ed55ea0fe280dbbbc0a44bf222278de6e716e143ca1e95ca320b06d4d23d6583fbf8d03e1428f3dac8fa00e5b82ddcd6b425e6236d85af09550a4
|
||||||
|
# spirv-tools is stupid and doesn't know how to utilize system spirv headers
|
||||||
|
BUNDLED_PACKAGE ${YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS}
|
||||||
|
)
|
||||||
|
|
||||||
AddJsonPackage(sirit)
|
AddJsonPackage(sirit)
|
||||||
|
|
||||||
|
@ -138,16 +144,19 @@ AddJsonPackage(
|
||||||
BUNDLED_PACKAGE ${YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES}
|
BUNDLED_PACKAGE ${YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
# SPIRV Tools
|
# SPIRV-Tools
|
||||||
AddJsonPackage(
|
AddPackage(
|
||||||
NAME spirv-tools
|
NAME SPIRV-Tools
|
||||||
BUNDLED_PACKAGE ${YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS}
|
REPO "KhronosGroup/SPIRV-Tools"
|
||||||
|
SHA 40eb301f32
|
||||||
|
HASH 58d0fb1047d69373cf24c73e6f78c73a72a6cca3b4df1d9f083b9dcc0962745ef154abf3dbe9b3623b835be20c6ec769431cf11733349f45e7568b3525f707aa
|
||||||
|
OPTIONS
|
||||||
|
"SPIRV_SKIP_EXECUTABLES ON"
|
||||||
|
"SPIRV_TOOLS_BUILD_STATIC ON"
|
||||||
|
BUNDLED_PACKAGE ${YUZU_USE_EXTERNAL_SPIRV_TOOLS}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (SPIRV-Tools_ADDED)
|
set(SPIRV-Tools_ADDED "${SPIRV-Tools_ADDED}" PARENT_SCOPE)
|
||||||
add_library(SPIRV-Tools::SPIRV-Tools ALIAS SPIRV-Tools-static)
|
|
||||||
target_link_libraries(SPIRV-Tools-static PRIVATE SPIRV-Tools-opt SPIRV-Tools-link)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# TZDB (Time Zone Database)
|
# TZDB (Time Zone Database)
|
||||||
add_subdirectory(nx_tzdb)
|
add_subdirectory(nx_tzdb)
|
||||||
|
|
|
@ -1184,7 +1184,6 @@ else()
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_include_directories(core PRIVATE ${OPUS_INCLUDE_DIRS})
|
|
||||||
target_link_libraries(core PUBLIC common PRIVATE audio_core hid_core network video_core nx_tzdb tz)
|
target_link_libraries(core PUBLIC common PRIVATE audio_core hid_core network video_core nx_tzdb tz)
|
||||||
|
|
||||||
if (BOOST_NO_HEADERS)
|
if (BOOST_NO_HEADERS)
|
||||||
|
|
|
@ -246,7 +246,9 @@ add_library(shader_recompiler STATIC
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(shader_recompiler PUBLIC common fmt::fmt sirit SPIRV-Tools::SPIRV-Tools)
|
# This can actually cause issues e.g. with Apple
|
||||||
|
# but forcing external spirv-tools works there
|
||||||
|
target_link_libraries(shader_recompiler PUBLIC common fmt::fmt sirit SPIRV-Tools-opt SPIRV-Tools SPIRV-Tools-link)
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
target_compile_options(shader_recompiler PRIVATE
|
target_compile_options(shader_recompiler PRIVATE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue