This commit is contained in:
TheBrokenRail 2024-06-04 18:26:45 -04:00
parent a17817a57b
commit 2a1ee6a91b
2 changed files with 24 additions and 12 deletions

View File

@ -7,12 +7,14 @@ project(trampoline)
add_library(trampoline-headers INTERFACE) add_library(trampoline-headers INTERFACE)
target_include_directories(trampoline-headers INTERFACE include) target_include_directories(trampoline-headers INTERFACE include)
# Build
if(NOT TRAMPOLINE_HEADERS_ONLY)
# Check Architecture # Check Architecture
include(CheckSymbolExists) include(CheckSymbolExists)
check_symbol_exists("__aarch64__" "" USE_NATIVE_TRAMPOLINE) check_symbol_exists("__aarch64__" "" USE_NATIVE_TRAMPOLINE)
check_symbol_exists("__x86_64__" "" USE_QEMU_TRAMPOLINE) check_symbol_exists("__x86_64__" "" USE_QEMU_TRAMPOLINE)
# Build # Include Correct Sub-Project
if(USE_NATIVE_TRAMPOLINE) if(USE_NATIVE_TRAMPOLINE)
add_subdirectory(native) add_subdirectory(native)
elseif(USE_QEMU_TRAMPOLINE) elseif(USE_QEMU_TRAMPOLINE)
@ -21,3 +23,8 @@ elseif(USE_QEMU_TRAMPOLINE)
else() else()
message(FATAL_ERROR "Unsupported Architecture") message(FATAL_ERROR "Unsupported Architecture")
endif() endif()
else()
# No-Op Install Function
function(install_trampoline)
endfunction()
endif()

View File

@ -1,5 +1,10 @@
project(qemu) project(qemu)
# Avoid Warning About DOWNLOAD_EXTRACT_TIMESTAMP
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24.0)
cmake_policy(SET CMP0135 NEW)
endif()
# Archive # Archive
if(NOT DEFINED TRAMPOLINE_QEMU_ARCHIVE) if(NOT DEFINED TRAMPOLINE_QEMU_ARCHIVE)
message(FATAL_ERROR "Missing QEMU Archive") message(FATAL_ERROR "Missing QEMU Archive")
@ -51,7 +56,7 @@ ExternalProject_Add(qemu
# Install # Install
function(install_trampoline bin_dir legal_dir) function(install_trampoline bin_dir legal_dir)
ExternalProject_Get_property(qemu BINARY_DIR) ExternalProject_Get_property(qemu BINARY_DIR)
install(PROGRAMS "${BINARY_DIR}/qemu-arm" DESTINATION "${bin_dir}/trampoline") install(PROGRAMS "${BINARY_DIR}/qemu-arm" DESTINATION "${bin_dir}" RENAME "trampoline")
# License # License
ExternalProject_Get_property(qemu SOURCE_DIR) ExternalProject_Get_property(qemu SOURCE_DIR)
install(FILES "${SOURCE_DIR}/COPYING" DESTINATION "${legal_dir}/qemu") install(FILES "${SOURCE_DIR}/COPYING" DESTINATION "${legal_dir}/qemu")