runtime/CMakeLists.txt

47 lines
937 B
CMake
Raw Normal View History

2024-06-04 17:22:15 -04:00
cmake_minimum_required(VERSION 3.17.0)
# Start Project
2024-06-08 05:28:22 -04:00
project(runtime)
2024-06-04 17:22:15 -04:00
2024-06-04 17:50:17 -04:00
# Headers
2025-01-04 05:34:24 -05:00
add_subdirectory(lib)
if(TARGET trampoline)
2024-11-10 05:26:16 -05:00
return()
endif()
2024-06-04 17:50:17 -04:00
# Build
2024-11-10 05:26:16 -05:00
add_executable(runtime
src/main.cpp
src/trampoline.cpp
src/pipe/loop.cpp
src/pipe/main.cpp
src/pipe/memory.cpp
)
# QEMU
check_symbol_exists("__x86_64__" "" USE_QEMU)
if(USE_QEMU)
add_subdirectory(qemu)
target_sources(runtime PRIVATE
src/syscall/main.cpp
src/syscall/handler.cpp
src/qemu/qemu.cpp
)
endif()
# Warnings
target_compile_options(runtime PRIVATE -Wall -Wextra -Werror -Wpointer-arith -Wshadow -Wnull-dereference)
# Link
2025-01-04 05:34:24 -05:00
target_link_libraries(runtime
dl
rt
trampoline-headers
)
2024-11-10 05:26:16 -05:00
# Install
if(DEFINED MCPI_BIN_DIR)
install(TARGETS runtime DESTINATION "${MCPI_BIN_DIR}")
2025-01-04 05:34:24 -05:00
# License
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" DESTINATION "${MCPI_LEGAL_DIR}/${PROJECT_NAME}")
2024-06-04 17:50:17 -04:00
endif()