mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-10 05:28:56 +02:00
Successor to that old MoltenVK PR. Does a lot of cleanups within root CMakeLists.txt, hands over MoltenVK and VulkanValidationLayers to CPMUtil, and separates out common operations into my modules. Hopefully reduces the monstrosity that is root CMakeLists.txt. Please test: - builds on all platforms - VulkanValidationLayers Signed-off-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3126 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
29 lines
1.2 KiB
CMake
29 lines
1.2 KiB
CMake
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
function(target_architecture_specific_sources project arch)
|
|
if (NOT MULTIARCH_BUILD)
|
|
target_sources("${project}" PRIVATE ${ARGN})
|
|
return()
|
|
endif()
|
|
|
|
foreach(input_file IN LISTS ARGN)
|
|
if(input_file MATCHES ".cpp$")
|
|
if(NOT IS_ABSOLUTE ${input_file})
|
|
set(input_file "${CMAKE_CURRENT_SOURCE_DIR}/${input_file}")
|
|
endif()
|
|
|
|
set(output_file "${CMAKE_CURRENT_BINARY_DIR}/arch_gen/${input_file}")
|
|
add_custom_command(
|
|
OUTPUT "${output_file}"
|
|
COMMAND ${CMAKE_COMMAND} "-Darch=${arch}"
|
|
"-Dinput_file=${input_file}"
|
|
"-Doutput_file=${output_file}"
|
|
-P "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/impl/TargetArchitectureSpecificSourcesWrapFile.cmake"
|
|
DEPENDS "${input_file}"
|
|
VERBATIM
|
|
)
|
|
target_sources(${project} PRIVATE "${output_file}")
|
|
endif()
|
|
endforeach()
|
|
endfunction()
|