wraith-lang/CMakeLists.txt

61 lines
1.4 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})
2021-04-28 22:21:51 +00:00
BISON_TARGET(Parser generators/wraith.y ${CMAKE_CURRENT_BINARY_DIR}/y.tab.c COMPILE_FLAGS "-d -v -t")
FLEX_TARGET(Scanner generators/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(
2021-04-22 05:26:34 +00:00
wraith
2021-04-28 22:21:51 +00:00
# Libs
lib/dropt/dropt.h
lib/dropt/dropt_string.h
lib/dropt/dropt.c
lib/dropt/dropt_string.c
lib/dropt/dropt_handlers.c
# Source
src/ast.h
src/codegen.h
2021-04-28 23:01:48 +00:00
src/parser.h
2021-04-28 22:21:51 +00:00
src/stack.h
src/ast.c
src/codegen.c
2021-04-28 23:01:48 +00:00
src/parser.c
src/stack.c
src/main.c
2021-04-28 22:21:51 +00:00
# Generated code
${BISON_Parser_OUTPUTS}
${FLEX_Scanner_OUTPUTS}
)
2021-04-18 22:29:54 +00:00
2021-04-22 05:26:34 +00:00
if(NOT MSVC)
set_property(TARGET wraith PROPERTY COMPILE_FLAGS "-std=gnu99 -Wall -Wno-strict-aliasing -pedantic")
endif()
target_link_libraries(wraith PUBLIC LLVM)