[Build/macOS] Exclude empty translation units and Vulkan/SPIR-V targets
This commit is contained in:
@@ -5,7 +5,7 @@ include(CMakeParseArguments)
|
||||
|
||||
# Platform suffix lists for file filtering
|
||||
set(XE_PLATFORM_SUFFIXES
|
||||
_win _linux _posix _gnulinux _x11 _gtk _android _mac _amd64 _arm64
|
||||
_win _linux _posix _gnulinux _x11 _gtk _android _mac _amd64 _x64 _arm64
|
||||
)
|
||||
|
||||
# xe_platform_sources(target base_path [RECURSIVE])
|
||||
@@ -81,7 +81,8 @@ function(xe_platform_sources target base_path)
|
||||
|
||||
# Add back architecture-specific files
|
||||
if(XE_TARGET_X86_64)
|
||||
file(${glob_mode} _arch_sources "${base_path}/*_amd64.h" "${base_path}/*_amd64.cc")
|
||||
file(${glob_mode} _arch_sources "${base_path}/*_amd64.h" "${base_path}/*_amd64.cc"
|
||||
"${base_path}/*_x64.h" "${base_path}/*_x64.cc")
|
||||
elseif(XE_TARGET_AARCH64)
|
||||
file(${glob_mode} _arch_sources "${base_path}/*_arm64.h" "${base_path}/*_arm64.cc")
|
||||
endif()
|
||||
|
||||
@@ -58,13 +58,11 @@ target_link_libraries(xenia-app PRIVATE
|
||||
xenia-cpu
|
||||
xenia-gpu
|
||||
xenia-gpu-null
|
||||
xenia-gpu-vulkan
|
||||
xenia-hid
|
||||
xenia-hid-nop
|
||||
xenia-kernel
|
||||
xenia-patcher
|
||||
xenia-ui
|
||||
xenia-ui-vulkan
|
||||
xenia-vfs
|
||||
# Third-party
|
||||
aes_128
|
||||
@@ -72,7 +70,6 @@ target_link_libraries(xenia-app PRIVATE
|
||||
fmt
|
||||
dxbc
|
||||
discord-rpc
|
||||
glslang-spirv
|
||||
imgui
|
||||
libavcodec
|
||||
libavutil
|
||||
@@ -81,6 +78,15 @@ target_link_libraries(xenia-app PRIVATE
|
||||
xxhash
|
||||
)
|
||||
|
||||
# Vulkan/SPIR-V backends (not macOS)
|
||||
if(NOT APPLE)
|
||||
target_link_libraries(xenia-app PRIVATE
|
||||
xenia-gpu-vulkan
|
||||
xenia-ui-vulkan
|
||||
glslang-spirv
|
||||
)
|
||||
endif()
|
||||
|
||||
# Non-Android specific (always true for Windows/Linux)
|
||||
target_link_libraries(xenia-app PRIVATE
|
||||
xenia-app-discord
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
add_library(xenia-gpu STATIC)
|
||||
xe_platform_sources(xenia-gpu ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
if(APPLE)
|
||||
# No Vulkan/SPIR-V backend on macOS — remove spirv_* sources
|
||||
get_target_property(_gpu_srcs xenia-gpu SOURCES)
|
||||
list(FILTER _gpu_srcs EXCLUDE REGEX "spirv_")
|
||||
set_target_properties(xenia-gpu PROPERTIES SOURCES "${_gpu_srcs}")
|
||||
target_link_libraries(xenia-gpu PUBLIC dxbc fmt snappy xxhash xenia-base xenia-ui)
|
||||
else()
|
||||
target_include_directories(xenia-gpu PRIVATE
|
||||
${PROJECT_SOURCE_DIR}/third_party/Vulkan-Headers/include
|
||||
${PROJECT_SOURCE_DIR}/third_party/glslang
|
||||
)
|
||||
target_link_libraries(xenia-gpu PUBLIC dxbc fmt glslang-spirv snappy xxhash xenia-base xenia-ui)
|
||||
endif()
|
||||
xe_target_defaults(xenia-gpu)
|
||||
|
||||
if(XENIA_BUILD_MISC)
|
||||
|
||||
15
third_party/CMakeLists.txt
vendored
15
third_party/CMakeLists.txt
vendored
@@ -144,8 +144,9 @@ add_library(fmt STATIC
|
||||
target_include_directories(fmt PUBLIC fmt/include)
|
||||
|
||||
# ==============================================================================
|
||||
# glslang-spirv
|
||||
# glslang-spirv (not needed on macOS — no Vulkan/SPIR-V backend)
|
||||
# ==============================================================================
|
||||
if(NOT APPLE)
|
||||
file(GLOB _glslang_spirv_cpp "glslang/SPIRV/*.cpp")
|
||||
file(GLOB _glslang_spirv_h "glslang/SPIRV/*.h")
|
||||
file(GLOB _glslang_spirv_hpp "glslang/SPIRV/*.hpp11")
|
||||
@@ -157,6 +158,7 @@ add_library(glslang-spirv STATIC
|
||||
glslang/glslang/Include/visibility.h
|
||||
)
|
||||
target_include_directories(glslang-spirv PUBLIC glslang)
|
||||
endif()
|
||||
|
||||
# ==============================================================================
|
||||
# imgui
|
||||
@@ -234,6 +236,7 @@ target_include_directories(xxhash PUBLIC xxhash)
|
||||
# zstd
|
||||
# ==============================================================================
|
||||
file(GLOB_RECURSE _zstd_common "zstd/lib/common/*.c" "zstd/lib/common/*.h")
|
||||
list(FILTER _zstd_common EXCLUDE REGEX "threading\\.c$")
|
||||
file(GLOB_RECURSE _zstd_compress "zstd/lib/compress/*.c" "zstd/lib/compress/*.h")
|
||||
file(GLOB_RECURSE _zstd_decompress "zstd/lib/decompress/*.c" "zstd/lib/decompress/*.h")
|
||||
add_library(zstd STATIC
|
||||
@@ -294,13 +297,21 @@ file(GLOB _zlibng_c "zlib-ng/*.c")
|
||||
file(GLOB _zlibng_generic "zlib-ng/arch/generic/*.c")
|
||||
if(XE_TARGET_AARCH64)
|
||||
file(GLOB _zlibng_arch "zlib-ng/arch/arm/*.c")
|
||||
list(FILTER _zlibng_arch EXCLUDE REGEX "armv6")
|
||||
add_library(zlib-ng STATIC
|
||||
${_zlibng_c}
|
||||
${_zlibng_arch}
|
||||
${_zlibng_generic}
|
||||
)
|
||||
target_compile_definitions(zlib-ng PRIVATE
|
||||
ARM_FEATURES
|
||||
ARM_NEON
|
||||
ARM_NEON_HASLD4
|
||||
ARM_ACLE
|
||||
HAVE_ARM_ACLE_H
|
||||
WITH_GZFILEOP
|
||||
HAVE_BUILTIN_CTZ
|
||||
HAVE_BUILTIN_CTZLL
|
||||
)
|
||||
else()
|
||||
file(GLOB _zlibng_x86 "zlib-ng/arch/x86/*.c")
|
||||
@@ -766,7 +777,6 @@ if(XE_TARGET_AARCH64)
|
||||
xe_add_gas_sources(libavcodec
|
||||
FFmpeg/libavcodec/aarch64/idctdsp_neon.S
|
||||
FFmpeg/libavcodec/aarch64/mpegaudiodsp_neon.S
|
||||
FFmpeg/libavcodec/aarch64/neon.S
|
||||
FFmpeg/libavcodec/aarch64/simple_idct_neon.S
|
||||
)
|
||||
endif()
|
||||
@@ -789,7 +799,6 @@ add_library(libavformat STATIC
|
||||
FFmpeg/libavformat/metadata.c
|
||||
FFmpeg/libavformat/mux.c
|
||||
FFmpeg/libavformat/options.c
|
||||
FFmpeg/libavformat/os_support.c
|
||||
FFmpeg/libavformat/protocols.c
|
||||
FFmpeg/libavformat/riff.c
|
||||
FFmpeg/libavformat/sdp.c
|
||||
|
||||
Reference in New Issue
Block a user