Skip to content

Commit

Permalink
attempt an alternative
Browse files Browse the repository at this point in the history
Signed-off-by: Martmists <[email protected]>
  • Loading branch information
Martmists-GH committed Jul 19, 2024
1 parent 251ad75 commit 667a8dc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ jobs:
path: ~/.konan
key: ${{ runner.os }}-konan

- run: |
ls ~/.konan/dependencies
- name: Gradle Build
uses: gradle/gradle-build-action@v2
with:
Expand Down
17 changes: 15 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
import org.jetbrains.kotlin.compilerRunner.konanHome
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile

plugins {
kotlin("multiplatform") version "2.0.0"
Expand Down Expand Up @@ -79,11 +80,23 @@ kotlin {
extraOpts("-Xsource-compiler-option", "-std=c++20")
extraOpts("-Xsource-compiler-option", "-O2")

if (File("~/.konan/dependencies").exists()) {
for (file in File("~/.konan/dependencies").listFiles()!!) {
println(file)
}
}

if (target.name.startsWith("macos")) {
extraOpts("-Xsource-compiler-option", "-isystem/Library/Developer/CommandLineTools/usr/lib/clang/15.0.0/include")
extraOpts("-Xsource-compiler-option", "-isystem~/.konan/dependencies/llvm-11.1.0-macos-${if (System.getProperty("os.arch") in arrayOf("amd64", "x86_64")) "x64" else "aarch64"}-essentials")
extraOpts("-Xsource-compiler-option", "-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk")
}

@Suppress("INVISIBLE_MEMBER")
println(konanHome)

println(target.konanTarget)
println(target.konanTarget.visibleName)

val cppSource = projectDir.resolve("src/lib/cpp").listFiles().filter { it.extension == "cpp" }.map { it.absolutePath }
cppSource.forEach {
extraOpts("-Xcompile-source", it)
Expand Down

0 comments on commit 667a8dc

Please sign in to comment.