diff --git CMakeLists.txt CMakeLists.txt
index e5b7482..136476b 100644
|
|
project (ClangLazy) |
3 | 3 | |
4 | 4 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) |
5 | 5 | find_package(Clang 3.6 MODULE REQUIRED) |
| 6 | # message(STATUS "Found Clang version ${LLVM_VERSION}") |
6 | 7 | |
7 | 8 | set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) |
8 | 9 | set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib ) |
… |
… |
add_definitions (-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS) |
12 | 13 | add_definitions (-D_GNU_SOURCE -DHAVE_CLANG_CONFIG_H) |
13 | 14 | |
14 | 15 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -fno-exceptions -fno-rtti") |
15 | | set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-flat_namespace -Wl,-undefined -Wl,suppress") |
| 16 | # set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-flat_namespace -Wl,-undefined -Wl,suppress") |
16 | 17 | if(NOT WIN32) |
17 | 18 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") |
18 | 19 | endif() |
… |
… |
LIST(REMOVE_ITEM LLVM_LIBS_LIST "-lLLVMSupport") # Remove element |
34 | 35 | macro(add_clang_plugin name) |
35 | 36 | set (srcs ${ARGN}) |
36 | 37 | |
| 38 | add_definitions(${LLVM_CFLAGS}) |
| 39 | |
37 | 40 | include_directories(${CLANG_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}) |
38 | 41 | link_directories("${LLVM_INSTALL_PREFIX}/lib" ${LLVM_LIBRARY_DIRS}) |
39 | 42 | |
… |
… |
macro(add_clang_plugin name) |
51 | 54 | foreach (llvm_lib ${LLVM_LIBS_LIST}) |
52 | 55 | target_link_libraries( ${name} ${llvm_lib} ) |
53 | 56 | endforeach() |
| 57 | target_link_libraries( ${name} "-lLLVM-${LLVM_VERSION}" ) |
54 | 58 | |
55 | 59 | foreach (user_lib ${USER_LIBS}) |
56 | 60 | target_link_libraries( ${name} ${user_lib} ) |
… |
… |
set_target_properties(ClangLazy PROPERTIES |
129 | 133 | |
130 | 134 | include("GNUInstallDirs") |
131 | 135 | install(TARGETS ClangLazy RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} |
132 | | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
| 136 | LIBRARY DESTINATION @LLVM_INSTALL_PREFIX@/lib |
133 | 137 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
134 | 138 | if(NOT WIN32) |
135 | 139 | install(FILES ${CMAKE_SOURCE_DIR}/clazy DESTINATION bin PERMISSIONS OWNER_WRITE OWNER_EXECUTE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE) |