2024-06-08 09:28:22 +00:00
|
|
|
project(native-runtime)
|
2024-06-04 21:50:17 +00:00
|
|
|
|
|
|
|
# Build
|
2024-06-08 09:28:22 +00:00
|
|
|
add_executable(runtime
|
2024-06-06 01:18:48 +00:00
|
|
|
src/memory.cpp
|
|
|
|
src/main.cpp
|
|
|
|
src/trampoline.cpp
|
2024-06-08 20:28:47 +00:00
|
|
|
src/loop.cpp
|
2024-06-06 01:18:48 +00:00
|
|
|
src/signals.cpp
|
|
|
|
)
|
2024-06-04 21:50:17 +00:00
|
|
|
|
|
|
|
# Warnings
|
2024-06-08 09:28:22 +00:00
|
|
|
target_compile_options(runtime PRIVATE -Wall -Wextra -Werror -Wpointer-arith -Wshadow -Wnull-dereference)
|
2024-06-04 21:50:17 +00:00
|
|
|
|
|
|
|
# Link
|
2024-06-08 09:28:22 +00:00
|
|
|
target_link_libraries(runtime dl rt trampoline-headers)
|
2024-06-04 21:50:17 +00:00
|
|
|
|
2024-06-05 04:11:54 +00:00
|
|
|
# RPath
|
2024-06-08 09:28:22 +00:00
|
|
|
set_target_properties(runtime PROPERTIES INSTALL_RPATH "${RUNTIME_RPATH}")
|
|
|
|
target_link_options(runtime PRIVATE "LINKER:${RUNTIME_EXTRA_LINK_FLAG}")
|
2024-06-05 04:11:54 +00:00
|
|
|
|
2024-06-04 21:50:17 +00:00
|
|
|
# Install
|
2024-06-08 09:28:22 +00:00
|
|
|
function(install_runtime bin_dir)
|
|
|
|
install(TARGETS runtime DESTINATION "${bin_dir}")
|
2024-06-04 21:50:17 +00:00
|
|
|
endfunction()
|