From 56a214c45449908a9e72cbc4f951da77fb408424 Mon Sep 17 00:00:00 2001 From: Vasily Levchenko Date: Wed, 20 Dec 2017 11:23:40 +0300 Subject: [PATCH] [build][gradle][4.4] upgrade (HACK inside see comment in body) Gradle native software plugins adds -I/usr/include that inroduce conflict with our --systemroot flags, so we had to add following hack over it: /* HACK over gradle 4.4, it adds /usr/include, that affects our --sysroot flag */ toolChains { clang(Clang) { eachPlatform { cppCompiler.withArguments { args -> args.remove /usr/include } } } } --- Interop/Indexer/build.gradle | 10 ++++++++++ gradle/wrapper/gradle-wrapper.properties | 2 +- libclangext/build.gradle | 11 +++++++++++ llvmDebugInfoC/build.gradle | 13 ++++++++++++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/Interop/Indexer/build.gradle b/Interop/Indexer/build.gradle index 91f41dea278..7d74180b85a 100644 --- a/Interop/Indexer/build.gradle +++ b/Interop/Indexer/build.gradle @@ -82,6 +82,16 @@ model { } } + /* HACK over gradle 4.4, it adds /usr/include, that affects our --sysroot flag */ + toolChains { + clang(Clang) { + eachPlatform { + cppCompiler.withArguments { args -> + args.remove "/usr/include" + } + } + } + } } sourceSets { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 702c4b68b8c..b6517bb1d16 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.3.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip diff --git a/libclangext/build.gradle b/libclangext/build.gradle index 2f4a6906c28..69fe773d851 100644 --- a/libclangext/build.gradle +++ b/libclangext/build.gradle @@ -39,4 +39,15 @@ model { } } } + + /* HACK over gradle 4.4, it adds /usr/include, that affects our --sysroot flag */ + toolChains { + clang(Clang) { + eachPlatform { + cppCompiler.withArguments { args -> + args.remove "/usr/include" + } + } + } + } } diff --git a/llvmDebugInfoC/build.gradle b/llvmDebugInfoC/build.gradle index 169ab45f366..a503139b2aa 100644 --- a/llvmDebugInfoC/build.gradle +++ b/llvmDebugInfoC/build.gradle @@ -25,7 +25,7 @@ model { binaries.withType(StaticLibraryBinarySpec) { binary -> if (!project.parent.convention.plugins.platformInfo.isWindows()) cppCompiler.args "-fPIC" - cppCompiler.args "--std=c++11", "-g", "-I${llvmDir}/include", "-I${projectDir}/src/main/include" + cppCompiler.args "--std=c++11", "-I${llvmDir}/include", "-I${projectDir}/src/main/include" linker.args "-L${llvmDir}/lib", "-lLLVMCore", "-lLLVMSupport" } binaries.withType(SharedLibraryBinarySpec) { binary -> @@ -33,4 +33,15 @@ model { } } } + + /* HACK over gradle 4.4, it adds /usr/include, that affects our --sysroot flag */ + toolChains { + clang(Clang) { + eachPlatform { + cppCompiler.withArguments { args -> + args.remove "/usr/include" + } + } + } + } }