Adding LLVM stuff to CMake build script.

This commit is contained in:
Stefano Sanfilippo 2015-03-07 17:23:46 +01:00
parent a313d4865c
commit 226aff325f
2 changed files with 11 additions and 4 deletions

View File

@ -22,7 +22,7 @@
#include "Nodes.hpp" #include "Nodes.hpp"
#include "RuntimePrototypes.hpp" #include "RuntimePrototypes.hpp"
#include <llvm/Analysis/Verifier.h> #include <llvm/IR/Verifier.h>
#include <llvm/IR/DerivedTypes.h> #include <llvm/IR/DerivedTypes.h>
#include <llvm/IR/IRBuilder.h> #include <llvm/IR/IRBuilder.h>
#include <llvm/IR/LLVMContext.h> #include <llvm/IR/LLVMContext.h>

View File

@ -65,15 +65,17 @@ elseif(BISON_VERSION VERSION_LESS 3.0)
endif() endif()
## 3. External components ## 3. External components
find_package(Boost 1.54 REQUIRED) find_package(Boost 1.54 REQUIRED)
find_package(LLVM REQUIRED CONFIG)
add_definitions( add_definitions(
${Boost_DEFINITIONS} ${Boost_DEFINITIONS}
${LLVM_DEFINITIONS}
) )
include_directories( include_directories(
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
${LLVM_INCLUDE_DIRS}
) )
## 4. Build ## 4. Build
@ -90,12 +92,17 @@ flex_target(Scanner Monicelli.lpp ${CMAKE_CURRENT_BINARY_DIR}/Lexer.cpp)
add_flex_bison_dependency(Scanner Parser) add_flex_bison_dependency(Scanner Parser)
add_executable(mcc add_executable(mcc
main.cpp main.cpp Nodes.cpp
${BISON_Parser_OUTPUTS} ${FLEX_Scanner_OUTPUTS} ${BISON_Parser_OUTPUTS} ${FLEX_Scanner_OUTPUTS}
CppEmitter.cpp CppEmitter.cpp BitcodeEmitter.cpp
)
llvm_map_components_to_libnames(LLVM_LIBRARIES
support core jit native bitwriter
) )
target_link_libraries(mcc target_link_libraries(mcc
${Boost_LIBRARIES} ${Boost_LIBRARIES}
${LLVM_LIBRARIES}
) )