wraith-lang/CMakeLists.txt

43 lines
1.0 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 2.8.12)
project(WRAITH_LANG C)
set(CMAKE_C_STANDARD 99)
2021-04-20 01:18:45 +00:00
# Build Type
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
# By default, we use Release
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE "Release" CACHE
STRING "Choose the type of build." FORCE
)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
STRINGS "Debug" "Release" "RelWithDebInfo"
)
endif()
find_package(BISON)
find_package(FLEX)
2021-04-18 22:29:54 +00:00
find_package(LLVM)
include_directories(${CMAKE_SOURCE_DIR})
BISON_TARGET(Parser wraith.y ${CMAKE_CURRENT_BINARY_DIR}/y.tab.c COMPILE_FLAGS -d)
FLEX_TARGET(Scanner wraith.lex ${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c)
ADD_FLEX_BISON_DEPENDENCY(Scanner Parser)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
2021-04-18 22:29:54 +00:00
add_executable(
wraith_compile
2021-04-18 22:29:54 +00:00
ast.c
stack.c
${BISON_Parser_OUTPUTS}
${FLEX_Scanner_OUTPUTS}
2021-04-18 22:29:54 +00:00
compiler.c
)
2021-04-18 22:29:54 +00:00
target_link_libraries(wraith_compile PUBLIC LLVM)