diff options
author | Sergio Martins <smartins@kde.org> | 2019-10-14 18:12:44 +0100 |
---|---|---|
committer | Sergio Martins <smartins@kde.org> | 2019-10-14 18:15:02 +0100 |
commit | 0d40517719631b3e99ac90d771e696e233835f13 (patch) | |
tree | 780b1b3628835bf1eb8f066b453996929f35af00 | |
parent | 5eedfd8b72174d8a12a761410383d2b16d0739d0 (diff) |
AppImage: Add cmake hack to build on our old Centos 6.8
No idea why we get those linker errors on Centos. Enabling those
libraries unconditionally would break Fedora.
This is probably due to a bug in llvm-config
-rw-r--r-- | CMakeLists.txt | 8 | ||||
-rwxr-xr-x | dev-scripts/docker/make_appimage.sh | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 67d82dc9..4e60d1f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,7 @@ add_definitions(-D_GNU_SOURCE -DHAVE_CLANG_CONFIG_H) 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) +option(APPIMAGE_HACK "Links the clazy plugin to the clang tooling libs only. For some reason this is needed when building on our old CentOS 6.8 to create the AppImage." OFF) 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.") @@ -140,6 +141,13 @@ macro(add_clang_plugin name) if (LINK_CLAZY_TO_LLVM) link_to_llvm(${name} FALSE) + else() + if (APPIMAGE_HACK) + # Hack to build on old CentOS 6.8 + target_link_libraries(${name} clangTooling) + target_link_libraries(${name} clangToolingCore) + target_link_libraries(${name} ${clang_tooling_refactoring_lib}) + endif() endif() if(MSVC) diff --git a/dev-scripts/docker/make_appimage.sh b/dev-scripts/docker/make_appimage.sh index f4a9fba7..bd4cbf94 100755 --- a/dev-scripts/docker/make_appimage.sh +++ b/dev-scripts/docker/make_appimage.sh @@ -25,7 +25,7 @@ echo "Checking out $1..." git checkout $1 echo "Building..." -cmake -DCMAKE_BUILD_TYPE=Release -DLINK_CLAZY_TO_LLVM=OFF -DCMAKE_INSTALL_PREFIX=/tmp/clazy_work/clazy.AppDir/usr . && make -j12 && make install +cmake -DCMAKE_BUILD_TYPE=Release -DAPPIMAGE_HACK=ON -DLINK_CLAZY_TO_LLVM=OFF -DCMAKE_INSTALL_PREFIX=/tmp/clazy_work/clazy.AppDir/usr . && make -j12 && make install echo "Fixing permissions..." chown -R $2 /tmp/clazy_work/clazy.AppDir/ |