Fixes
This commit is contained in:
parent
a17817a57b
commit
2a1ee6a91b
@ -7,17 +7,24 @@ 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)
|
||||||
|
|
||||||
# Check Architecture
|
|
||||||
include(CheckSymbolExists)
|
|
||||||
check_symbol_exists("__aarch64__" "" USE_NATIVE_TRAMPOLINE)
|
|
||||||
check_symbol_exists("__x86_64__" "" USE_QEMU_TRAMPOLINE)
|
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
if(USE_NATIVE_TRAMPOLINE)
|
if(NOT TRAMPOLINE_HEADERS_ONLY)
|
||||||
add_subdirectory(native)
|
# Check Architecture
|
||||||
elseif(USE_QEMU_TRAMPOLINE)
|
include(CheckSymbolExists)
|
||||||
add_subdirectory(qemu)
|
check_symbol_exists("__aarch64__" "" USE_NATIVE_TRAMPOLINE)
|
||||||
target_compile_definitions(trampoline-headers INTERFACE MCPI_USE_QEMU)
|
check_symbol_exists("__x86_64__" "" USE_QEMU_TRAMPOLINE)
|
||||||
|
|
||||||
|
# Include Correct Sub-Project
|
||||||
|
if(USE_NATIVE_TRAMPOLINE)
|
||||||
|
add_subdirectory(native)
|
||||||
|
elseif(USE_QEMU_TRAMPOLINE)
|
||||||
|
add_subdirectory(qemu)
|
||||||
|
target_compile_definitions(trampoline-headers INTERFACE MCPI_USE_QEMU)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Unsupported Architecture")
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Unsupported Architecture")
|
# No-Op Install Function
|
||||||
|
function(install_trampoline)
|
||||||
|
endfunction()
|
||||||
endif()
|
endif()
|
@ -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")
|
||||||
|
Loading…
Reference in New Issue
Block a user