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