cmake_minimum_required(VERSION 3.17.0) # Start Project project(trampoline) # Headers add_library(trampoline-headers INTERFACE) 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 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()