Files
BlitzLLVM/projects/code_compiler/CMakeLists.txt
T
Michael Fabian 'Xaymar' Dirks dcd8950260 code_compiler: Add initial Compiler and Parser
These don't do much yet and are just here so the class structure exists.
2017-11-13 02:16:17 +01:00

61 lines
941 B
CMake

cmake_minimum_required(VERSION 2.8.12)
project(CodeCompiler)
# Configuration
## Dependencies
# LLVM
find_package(LLVM REQUIRED CONFIG)
llvm_map_components_to_libnames(llvm_libs support core irreader)
# Boost
SET(Boost_USE_STATIC_LIBS ON)
find_package(Boost REQUIRED COMPONENTS program_options)
## Version
INCLUDE("CMakeVersion.txt")
## Compiling
# Source Files
SET(SOURCE
"source/main.cpp"
"source/lexer.hpp"
"source/lexer.cpp"
"source/parser.hpp"
"source/parser.cpp"
"source/compiler.hpp"
"source/compiler.cpp"
)
SET(DATA
"CMakeVersion.txt"
)
# Definitions
ADD_DEFINITIONS(
${LLVM_DEFINITIONS}
)
# Directories
INCLUDE_DIRECTORIES(
"${PROJECT_SOURCE_DIR}/source"
"${PROJECT_BINARY_DIR}"
${LLVM_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
LINK_DIRECTORIES(
${LLVM_LIBRARY_DIRS}
${Boost_LIBRARY_DIRS}
)
# Building
ADD_EXECUTABLE(cc
${SOURCE}
${DATA}
)
# Linking
TARGET_LINK_LIBRARIES(cc
${Boost_LIBRARIES}
${llvm_libs}
)