Added -isystem to Mac interop stub build, so that it doesn't lose the clang owned headers.
This commit is contained in:
committed by
alexander-gorshenev
parent
a995fbcb59
commit
aea99897c4
+19
-14
@@ -105,26 +105,31 @@ private fun runCmd(command: Array<String>, workDir: File, verbose: Boolean = fal
|
|||||||
private fun Properties.defaultCompilerOpts(dependencies: String): List<String> {
|
private fun Properties.defaultCompilerOpts(dependencies: String): List<String> {
|
||||||
val sysRootDir = this.getOsSpecific("sysRoot")!!
|
val sysRootDir = this.getOsSpecific("sysRoot")!!
|
||||||
val sysRoot= "$dependencies/$sysRootDir"
|
val sysRoot= "$dependencies/$sysRootDir"
|
||||||
|
val llvmHomeDir = this.getOsSpecific("llvmHome")!!
|
||||||
|
val llvmHome = "$dependencies/$llvmHomeDir"
|
||||||
|
val llvmVersion = this.getProperty("llvmVersion")!!
|
||||||
|
|
||||||
|
// StubGenerator passes the arguments to libclang which
|
||||||
|
// works not exactly the same way as the clang binary and
|
||||||
|
// (in particular) uses different default header search path.
|
||||||
|
// See e.g. http://lists.llvm.org/pipermail/cfe-dev/2013-November/033680.html
|
||||||
|
// We workaround the problem with -isystem flag below.
|
||||||
|
val isystem = "$llvmHome/lib/clang/$llvmVersion/include"
|
||||||
|
|
||||||
val host = detectHost()
|
val host = detectHost()
|
||||||
when (host) {
|
when (host) {
|
||||||
"osx" -> return listOf(
|
"osx" ->
|
||||||
"-B$sysRoot/usr/bin",
|
return listOf(
|
||||||
"--sysroot=$sysRoot",
|
"-isystem", isystem,
|
||||||
"-mmacosx-version-min=10.10")
|
"-B$sysRoot/usr/bin",
|
||||||
|
"--sysroot=$sysRoot",
|
||||||
|
"-mmacosx-version-min=10.10")
|
||||||
"linux" -> {
|
"linux" -> {
|
||||||
val llvmHomeDir = this.getOsSpecific("llvmHome")!!
|
|
||||||
val llvmHome = "$dependencies/$llvmHomeDir"
|
|
||||||
val llvmVersion = this.getProperty("llvmVersion")!!
|
|
||||||
val gccToolChainDir = this.getOsSpecific("gccToolChain")!!
|
val gccToolChainDir = this.getOsSpecific("gccToolChain")!!
|
||||||
val gccToolChain= "$dependencies/$gccToolChainDir"
|
val gccToolChain= "$dependencies/$gccToolChainDir"
|
||||||
// StubGenerator passes the arguments to libclang which
|
|
||||||
// works not exactly the same way as the clang binary and
|
|
||||||
// (in particular) uses different default header search path.
|
|
||||||
// See e.g. http://lists.llvm.org/pipermail/cfe-dev/2013-November/033680.html
|
|
||||||
// We workaround the problem with -isystem flag below.
|
|
||||||
return listOf(
|
return listOf(
|
||||||
"-isystem",
|
"-isystem", isystem,
|
||||||
"$llvmHome/lib/clang/$llvmVersion/include",
|
|
||||||
"--gcc-toolchain=$gccToolChain",
|
"--gcc-toolchain=$gccToolChain",
|
||||||
"-L$llvmHome/lib",
|
"-L$llvmHome/lib",
|
||||||
"-B$sysRoot/../bin",
|
"-B$sysRoot/../bin",
|
||||||
|
|||||||
Reference in New Issue
Block a user