2018-05-10 23:25:46 +00:00
|
|
|
add_definitions(-Wno-error -Wno-unused-parameter -Wno-non-virtual-dtor -U_LIBCPP_DEBUG)
|
2017-12-08 08:28:08 +00:00
|
|
|
|
2018-11-16 12:22:51 +00:00
|
|
|
link_directories(${LLVM_LIBRARY_DIRS})
|
|
|
|
|
2018-09-14 19:48:51 +00:00
|
|
|
add_library(clickhouse-compiler-lib ${LINK_MODE}
|
2017-11-12 12:58:40 +00:00
|
|
|
driver.cpp
|
|
|
|
cc1_main.cpp
|
|
|
|
cc1as_main.cpp
|
|
|
|
lld.cpp)
|
|
|
|
|
2017-12-09 16:36:03 +00:00
|
|
|
target_compile_options(clickhouse-compiler-lib PRIVATE -fno-rtti -fno-exceptions -g0)
|
2017-11-12 12:58:40 +00:00
|
|
|
|
2018-09-14 19:48:51 +00:00
|
|
|
string(REPLACE "${INCLUDE_DEBUG_HELPERS}" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # cant compile with -fno-rtti
|
|
|
|
|
2018-05-29 17:54:48 +00:00
|
|
|
llvm_libs_all(REQUIRED_LLVM_LIBRARIES)
|
2017-12-13 19:07:12 +00:00
|
|
|
|
2018-02-07 15:58:48 +00:00
|
|
|
message(STATUS "Using LLVM ${LLVM_VERSION}: ${LLVM_INCLUDE_DIRS} : ${REQUIRED_LLVM_LIBRARIES}")
|
2017-11-12 12:58:40 +00:00
|
|
|
|
2018-06-06 20:21:58 +00:00
|
|
|
target_include_directories(clickhouse-compiler-lib SYSTEM PRIVATE ${LLVM_INCLUDE_DIRS})
|
2017-11-12 16:45:30 +00:00
|
|
|
|
2017-11-12 12:58:40 +00:00
|
|
|
# This is extracted almost directly from CMakeFiles/.../link.txt in LLVM build directory.
|
|
|
|
|
2017-12-28 12:58:39 +00:00
|
|
|
target_link_libraries(clickhouse-compiler-lib PRIVATE
|
2017-11-12 12:58:40 +00:00
|
|
|
|
|
|
|
clangBasic clangCodeGen clangDriver clangFrontend clangFrontendTool
|
|
|
|
clangRewriteFrontend clangARCMigrate clangStaticAnalyzerFrontend
|
|
|
|
clangParse clangSerialization clangSema clangEdit clangStaticAnalyzerCheckers
|
|
|
|
clangASTMatchers clangStaticAnalyzerCore clangAnalysis clangAST clangRewrite clangLex clangBasic
|
|
|
|
|
|
|
|
lldCOFF
|
|
|
|
lldDriver
|
|
|
|
lldELF
|
2017-12-08 08:28:08 +00:00
|
|
|
#lldMinGW
|
2017-11-12 12:58:40 +00:00
|
|
|
lldMachO
|
|
|
|
lldReaderWriter
|
|
|
|
lldYAML
|
2017-12-08 08:28:08 +00:00
|
|
|
#lldCommon
|
2017-11-12 12:58:40 +00:00
|
|
|
lldCore
|
2017-12-08 08:28:08 +00:00
|
|
|
lldConfig
|
2017-11-12 12:58:40 +00:00
|
|
|
|
|
|
|
${REQUIRED_LLVM_LIBRARIES}
|
|
|
|
|
2017-12-08 08:28:08 +00:00
|
|
|
LLVMSupport
|
|
|
|
|
|
|
|
#Polly
|
|
|
|
#PollyISL
|
|
|
|
#PollyPPCG
|
2017-11-12 12:58:40 +00:00
|
|
|
|
2017-12-28 12:58:39 +00:00
|
|
|
PUBLIC ${ZLIB_LIBRARIES} ${EXECINFO_LIBRARY} Threads::Threads
|
2018-08-06 20:12:55 +00:00
|
|
|
${MALLOC_LIBRARIES}
|
|
|
|
${GLIBC_COMPATIBILITY_LIBRARIES}
|
|
|
|
${MEMCPY_LIBRARIES}
|
2017-12-21 13:07:07 +00:00
|
|
|
)
|