29 lines
1.0 KiB
CMake
29 lines
1.0 KiB
CMake
cmake_minimum_required(VERSION 3.21)
|
|
project(Elna)
|
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
find_package(Boost COMPONENTS process program_options REQUIRED)
|
|
find_package(FLEX)
|
|
include_directories(${Boost_INCLUDE_DIR})
|
|
|
|
FLEX_TARGET(scanner source/scanner.l ${CMAKE_CURRENT_BINARY_DIR}/scanner.cpp)
|
|
|
|
add_executable(elna cli/main.cpp
|
|
source/lexer.cpp include/elna/source/lexer.hpp
|
|
source/parser.cpp include/elna/source/parser.hpp
|
|
source/types.cpp include/elna/source/types.hpp
|
|
source/symbol_table.cpp include/elna/source/symbol_table.hpp
|
|
source/result.cpp include/elna/source/result.hpp
|
|
source/semantic.cpp include/elna/source/semantic.hpp
|
|
source/optimizer.cpp include/elna/source/optimizer.hpp
|
|
backend/riscv.cpp include/elna/backend/riscv.hpp
|
|
backend/target.cpp include/elna/backend/target.hpp
|
|
cli/cl.cpp include/elna/cli/cl.hpp
|
|
${FLEX_scanner_OUTPUTS}
|
|
)
|
|
target_include_directories(elna PRIVATE include)
|
|
target_link_libraries(elna LINK_PUBLIC ${Boost_LIBRARIES})
|