diff options
author | Sergio Martins <smartins@kde.org> | 2018-11-15 12:27:17 +0000 |
---|---|---|
committer | Sergio Martins <smartins@kde.org> | 2018-11-15 12:27:17 +0000 |
commit | 9f25aeaa0c46e97edaf28cc2e051e9692fb6b725 (patch) | |
tree | 3e15ed9b009c71a7b9b2307309db93b55862a1e4 | |
parent | 4beb5e594b34ba66cd51b63ece8c61395a406f3f (diff) |
Introduce cmake option: LINK_CLAZY_TO_LLVM
The default is ON, so nothing will change by default.
But to link against a static LLVM you probably want to set this
to OFF, specially if you're seeing runtime errors saying
"option foo registered more than once"
Will be using this option to make static builds work in the AppImage.
-rw-r--r-- | CMakeLists.txt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c883fd8f..607a7106 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,7 @@ 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_AST_MATCHERS_CRASH_WORKAROUND "Disable AST Matchers if being built with clang. See bug #392223" ON) +option(LINK_CLAZY_TO_LLVM "Links the clazy plugin to LLVM. Switch to OFF if your clang binary has all symbols already. Might need to be OFF if your LLVM is static." ON) if (CLAZY_AST_MATCHERS_CRASH_WORKAROUND AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") message("Enabling AST Matchers workaround. Consider building with gcc instead. See bug #392223.") @@ -128,7 +129,9 @@ macro(add_clang_plugin name) set_target_properties(${name} PROPERTIES LINK_FlAGS "-exported_symbols_list ${SYMBOL_FILE}") endif() - link_to_llvm(${name} FALSE) + if (LINK_CLAZY_TO_LLVM) + link_to_llvm(${name} FALSE) + endif() if(MSVC) target_link_libraries(${name} ${CLANG_LIBRARY_IMPORT}) # Link against clang.exe to share the plugin registry |