aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSergio Martins <smartins@kde.org>2017-07-08 19:15:10 +0100
committerSergio Martins <smartins@kde.org>2017-07-08 19:15:10 +0100
commitbe86fd5f855332b7120d60e8e65f43124e890a06 (patch)
treec92808af7a220f745a484c624af52ba68a01d1d2 /CMakeLists.txt
parentbe410c2d90c71e66f669ebb9dba37ceccb5337a5 (diff)
parentd7139725865d2ef3a2b596e80f9be6437ee90de5 (diff)
Merge branch '1.2' into master
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt21
1 files changed, 13 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 40d681eb..0743f360 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,7 +30,6 @@ add_definitions(-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS)
add_definitions(-D_GNU_SOURCE -DHAVE_CLANG_CONFIG_H)
option(CLAZY_BUILD_UTILS_LIB "Enable this option to build a library so you can reuse clazy's utility functions" OFF)
-option(CLAZY_BUILD_IS_MINIMAL "Enable this option to build clazy without any checks" OFF)
if (CLAZY_BUILD_UTILS_LIB)
add_definitions(-DCLAZY_BUILD_UTILS_LIB)
@@ -117,6 +116,9 @@ macro(link_to_llvm name llvm_libs)
target_link_libraries(${name} ${llvm_system_lib})
endforeach()
+ if(MSVC)
+ target_link_libraries(${name} version.lib)
+ endif()
endmacro()
macro(add_clang_plugin name)
@@ -131,15 +133,12 @@ macro(add_clang_plugin name)
link_to_llvm(${name} "${LLVM_LIBS_LIST}")
if(MSVC)
- target_link_libraries(${name} version.lib)
target_link_libraries(${name} ${CLANG_LIBRARY_IMPORT}) # Link against clang.exe to share the plugin registry
endif()
if(CLAZY_BUILD_UTILS_LIB)
target_link_libraries(${name} clazylib)
endif()
-
- generate_export_header(${name})
endmacro()
if(CLAZY_BUILD_UTILS_LIB)
@@ -163,7 +162,7 @@ endif()
set(SYMBOL_FILE Lazy.exports)
-add_clang_plugin(ClangLazy ${CLAZY_SRCS})
+add_clang_plugin(ClangLazy ${CLAZY_PLUGIN_SRCS})
set_target_properties(ClangLazy PROPERTIES
LINKER_LANGUAGE CXX
@@ -234,9 +233,15 @@ endif()
# Build clazy-standalone
-add_executable(clazy-standalone src/ClazyStandaloneMain.cpp)
-target_link_libraries(clazy-standalone ClangLazy)
-link_to_llvm(clazy-standalone "${CLAZY_STANDALONE_LLVM_LIBS}")
+add_executable(clazy-standalone ${CLAZY_STANDALONE_SRCS})
+if (MSVC)
+ # On MSVC clang-standalone crashes with a meaningless backtrace if linked to ClangLazy.dll
+ target_link_libraries(clazy-standalone clangFrontend)
+else()
+ target_link_libraries(clazy-standalone ClangLazy)
+endif()
+
+link_to_llvm(clazy-standalone "${CLAZY_STANDALONE_LLVM_LIBS}")
install(TARGETS clazy-standalone DESTINATION bin PERMISSIONS OWNER_WRITE OWNER_EXECUTE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE)