[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
      }
    }
  }
}
This commit is contained in:
Vasily Levchenko
2017-12-20 11:23:40 +03:00
committed by Vasily Levchenko
parent 3e949b4047
commit 56a214c454
4 changed files with 34 additions and 2 deletions
+10
View File
@@ -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 {
+1 -1
View File
@@ -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
+11
View File
@@ -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"
}
}
}
}
}
+12 -1
View File
@@ -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"
}
}
}
}
}