2024-02-18 11:26:57 +01:00
|
|
|
cmake_minimum_required(VERSION 3.21)
|
|
|
|
project(Elna)
|
|
|
|
|
2024-02-22 21:29:25 +01:00
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
|
2024-02-18 11:26:57 +01:00
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
2024-02-25 15:16:19 +01:00
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
2024-02-22 21:29:25 +01:00
|
|
|
|
2024-03-03 13:11:39 +01:00
|
|
|
find_package(Boost COMPONENTS program_options REQUIRED)
|
2024-04-06 16:10:07 +02:00
|
|
|
find_package(FLEX)
|
2024-03-03 13:11:39 +01:00
|
|
|
include_directories(${Boost_INCLUDE_DIR})
|
|
|
|
|
2024-03-07 09:15:11 +01:00
|
|
|
add_executable(tester tests/tester.cpp include/elna/tester.hpp)
|
2024-02-22 21:29:25 +01:00
|
|
|
target_include_directories(tester PRIVATE include)
|
|
|
|
|
2024-04-06 16:10:07 +02:00
|
|
|
FLEX_TARGET(scanner source/scanner.l ${CMAKE_CURRENT_BINARY_DIR}/scanner.cpp)
|
|
|
|
|
2024-03-07 09:15:11 +01:00
|
|
|
add_executable(elna cli/main.cpp
|
2024-03-06 07:51:56 +01:00
|
|
|
source/lexer.cpp include/elna/source/lexer.hpp
|
|
|
|
source/parser.cpp include/elna/source/parser.hpp
|
2024-05-01 10:39:18 +02:00
|
|
|
source/types.cpp include/elna/source/types.hpp
|
|
|
|
source/symbol_table.cpp include/elna/source/symbol_table.hpp
|
2024-03-07 09:15:11 +01:00
|
|
|
source/result.cpp include/elna/source/result.hpp
|
2024-03-14 08:52:45 +01:00
|
|
|
source/semantic.cpp include/elna/source/semantic.hpp
|
2024-04-18 12:15:26 +02:00
|
|
|
source/optimizer.cpp include/elna/source/optimizer.hpp
|
2024-03-07 09:15:11 +01:00
|
|
|
backend/riscv.cpp include/elna/backend/riscv.hpp
|
|
|
|
backend/target.cpp include/elna/backend/target.hpp
|
|
|
|
cli/cl.cpp include/elna/cli/cl.hpp
|
2024-04-06 16:10:07 +02:00
|
|
|
${FLEX_scanner_OUTPUTS}
|
2024-02-22 21:29:25 +01:00
|
|
|
)
|
2024-02-25 15:16:19 +01:00
|
|
|
target_include_directories(elna PRIVATE include)
|
2024-03-03 13:11:39 +01:00
|
|
|
target_link_libraries(elna LINK_PUBLIC ${Boost_LIBRARIES})
|