3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #59294 from matthewbauer/clang8-fix-darwin

clang8: apply patch to disable xpc
This commit is contained in:
Matthew Bauer 2019-04-11 13:39:59 -04:00 committed by GitHub
commit d95c4d799c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 1 deletions

View file

@ -0,0 +1,41 @@
From 61c9b97d7b81cc2c013b423bf1763a92b14fcae3 Mon Sep 17 00:00:00 2001
From: Jan Korous <jkorous@apple.com>
Date: Tue, 26 Mar 2019 03:48:25 +0000
Subject: [PATCH] [clangd][xpc][cmake] Respect explicit value of
CLANGD_BUILD_XPC
We shouldn't prevent user from disabling XPC framework build on Darwin.
However, by keeping it on by default our CI systems also test
it by default on macOS.
Based on user request:
http://lists.llvm.org/pipermail/cfe-dev/2019-March/061778.html
Differential Revision: https://reviews.llvm.org/D59808
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@356974 91177308-0d34-0410-b5e6-96231b3b80d8
---
CMakeLists.txt | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 66ebeaeeaa..514b17fb3c 100644
--- a/tools/extra/CMakeLists.txt
+++ b/tools/extra/CMakeLists.txt
@@ -1,6 +1,13 @@
-option(CLANGD_BUILD_XPC "Build XPC Support For Clangd." OFF)
-if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- set(CLANGD_BUILD_XPC ON CACHE BOOL "" FORCE)
+if (NOT DEFINED CLANGD_BUILD_XPC)
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ set(CLANGD_BUILD_XPC_DEFAULT ON)
+ else ()
+ set(CLANGD_BUILD_XPC_DEFAULT OFF)
+ endif ()
+
+ set(CLANGD_BUILD_XPC ${CLANGD_BUILD_XPC_DEFAULT} CACHE BOOL "Build XPC Support For Clangd." FORCE)
+
+ unset(CLANGD_BUILD_XPC_DEFAULT)
endif ()
add_subdirectory(clang-apply-replacements)

View file

@ -24,6 +24,7 @@ let
cmakeFlags = [
"-DCMAKE_CXX_FLAGS=-std=c++11"
"-DCLANGD_BUILD_XPC=OFF"
] ++ stdenv.lib.optionals enableManpages [
"-DCLANG_INCLUDE_DOCS=ON"
"-DLLVM_ENABLE_SPHINX=ON"
@ -35,7 +36,10 @@ let
"-DLINK_POLLY_INTO_TOOLS=ON"
];
patches = [ ./purity.patch ];
patches = [
./purity.patch
./clang-xpc.patch
];
postPatch = ''
sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \