Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ jobs:
- name: Build and Test ${{ env.PACKAGE_NAME }}
shell: msys2 {0}
run: |
echo $MINGW_PREFIX
./gradlew build -Paws.crt.disableContainerTargets=mingw_x64
- name: Save Test Reports
if: failure()
Expand Down
12 changes: 11 additions & 1 deletion aws-crt-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,19 @@ kotlin {
}

if (NATIVE_ENABLED && HostManager.hostIsMingw) {
println("CONFIGURING MINGW64 WinVer!")
mingwX64 {
val mingwHome = findMingwHome()
println("Found mingwHome at $mingwHome")
val defPath = layout.buildDirectory.file("cinterop/winver.def")
println("Writing winver.def to ${defPath.get().asFile.absolutePath}")

// Dynamically construct def file because of dynamic mingw paths
val defFileTask by tasks.registering {
outputs.file(defPath)

val mingwLibs = Paths.get(mingwHome, "lib").toString().replace("\\", "\\\\") // Windows path shenanigans
val mingwLibs = Paths.get(mingwHome, "lib").toString()//.replace("\\", "\\\\") // Windows path shenanigans
println("Using MinGW libs folder: $mingwLibs")

doLast {
Files.writeString(
Expand All @@ -138,14 +142,19 @@ kotlin {
)
}
}

compilations["main"].cinterops {
create("winver") {
println("Creating winver cinterop task")
val mingwIncludes = Paths.get(mingwHome, "include").toString()
println("Using MinGW includes at: $mingwIncludes")

includeDirs(mingwIncludes)
definitionFile.set(defPath)

// Ensure that the def file is written first
tasks[interopProcessingTaskName].dependsOn(defFileTask)
println("Done creating winver cinterop task")
}
}

Expand All @@ -156,6 +165,7 @@ kotlin {
"-v",
)
compilerOptions.freeCompilerArgs.addAll(compilerArgs)
println("Added compiler args: ${compilerArgs.joinToString()}")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ private fun runCmake(project: Project, target: KotlinNativeTarget, cmakeArgs: Li
"cmake"
}

project.logger.info("$exeName ${exeArgs.joinToString(separator = " ")}")
project.logger.warn("$exeName ${exeArgs.joinToString(separator = " ")}")
executable(exeName)
args(exeArgs)
}.result.get() // providers.exec is lazy, so fetch the result here to ensure the command executes
Expand Down
Loading