Files
BlitzLLVM/projects/code_compiler/CMakeLists.txt
T
Michael Fabian 'Xaymar' Dirks 00b37f0d05 code_compiler: Add LLVM, Boost, licensing and help
Boost is used to parse program arguments into a usable format, print help and so on. This makes it far easier to quickly get off the ground and is also reasonably fast with relatively small impact. Since Boost provides prebuilt versions with all recent compilers, it shouldn't impact newer people.

LLVM will be used for compiling the actual code, as of right now there is no Tokenizer, Parser or Compiler implemented. This will be the biggest task as it requires careful planning in order to not end up like Mark Sibly did with BlitzBasic and all the programming languages that ended up being created by it.

Additionally removed the VERSION_BUILD from the template so that version updates work better.
2017-11-12 01:38:50 +01:00

55 lines
813 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"
)
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}
)