forked from Lephenixnoir/fxos
64 lines
1.3 KiB
CMake
64 lines
1.3 KiB
CMake
cmake_minimum_required(VERSION 3.16)
|
|
project(fxos LANGUAGES C CXX)
|
|
find_package(FLEX 2.6)
|
|
|
|
add_compile_options(-Wall -Wextra -D_GNU_SOURCE -std=c++17 -O0 -g)
|
|
|
|
#---
|
|
# fxos core
|
|
#---
|
|
|
|
flex_target(LoadAsm lib/load-asm.l "${CMAKE_CURRENT_BINARY_DIR}/load-asm.yy.cpp" COMPILE_FLAGS -s)
|
|
|
|
set(fxos_core_SOURCES
|
|
lib/disassembly.cpp
|
|
lib/domains/relconst.cpp
|
|
lib/lang.cpp
|
|
lib/log.cpp
|
|
lib/memory.cpp
|
|
lib/os.cpp
|
|
lib/passes/cfg.cpp
|
|
lib/passes/pcrel.cpp
|
|
lib/passes/print.cpp
|
|
lib/passes/syscall.cpp
|
|
lib/semantics.cpp
|
|
lib/symbols.cpp
|
|
lib/util.cpp
|
|
lib/vspace.cpp)
|
|
|
|
add_library(fxos-core ${fxos_core_SOURCES} ${FLEX_LoadAsm_OUTPUTS})
|
|
target_include_directories(fxos-core PUBLIC include)
|
|
|
|
#---
|
|
# fxos shell
|
|
#---
|
|
|
|
flex_target(Lexer shell/lexer.l "${CMAKE_CURRENT_BINARY_DIR}/lexer.yy.cpp"
|
|
COMPILE_FLAGS -s)
|
|
|
|
set(fxos_shell_SOURCES
|
|
shell/main.cpp
|
|
shell/parser.cpp
|
|
shell/session.cpp
|
|
shell/theme.cpp
|
|
shell/a.cpp
|
|
shell/d.cpp
|
|
shell/e.cpp
|
|
shell/g.cpp
|
|
shell/h.cpp
|
|
shell/i.cpp
|
|
shell/s.cpp
|
|
shell/v.cpp
|
|
${FLEX_Lexer_OUTPUTS}
|
|
)
|
|
|
|
add_executable(fxos ${fxos_shell_SOURCES})
|
|
target_include_directories(fxos PRIVATE shell)
|
|
target_link_libraries(fxos fxos-core -lreadline -lfmt)
|
|
|
|
#---
|
|
# Install
|
|
#---
|
|
|
|
install(TARGETS fxos DESTINATION "${CMAKE_INSTALL_BINDIR}")
|