mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[ntcoreffi] Use static runtime for ntcoreffi (#7422)
This avoids requiring users of this library to keep up to date with the latest MSVC runtimes.
This commit is contained in:
9
.github/workflows/gradle.yml
vendored
9
.github/workflows/gradle.yml
vendored
@@ -96,9 +96,16 @@ jobs:
|
||||
task: "build"
|
||||
outputs: "build/allOutputs"
|
||||
- os: windows-2022
|
||||
artifact-name: Win32
|
||||
artifact-name: Win32FFI
|
||||
architecture: x86
|
||||
task: ":ntcoreffi:build"
|
||||
build-options: "-Pntcoreffibuild \"-Dorg.gradle.jvmargs=-Xmx1096m\""
|
||||
outputs: "ntcoreffi/build/outputs"
|
||||
- os: windows-2022
|
||||
artifact-name: Win64FFI
|
||||
architecture: x64
|
||||
task: ":ntcoreffi:build"
|
||||
build-options: "-Pntcoreffibuild -Pbuildwinarm64"
|
||||
outputs: "ntcoreffi/build/outputs"
|
||||
name: "Build - ${{ matrix.artifact-name }}"
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import org.gradle.internal.os.OperatingSystem
|
||||
|
||||
plugins {
|
||||
id 'c'
|
||||
id 'cpp'
|
||||
@@ -119,6 +121,10 @@ task cppHeadersZip(type: Zip) {
|
||||
}
|
||||
}
|
||||
|
||||
if (OperatingSystem.current().isWindows() && !project.hasProperty('ntcoreffibuild')) {
|
||||
return
|
||||
}
|
||||
|
||||
build.dependsOn cppHeadersZip
|
||||
addTaskToCopyAllOutputs(cppHeadersZip)
|
||||
|
||||
|
||||
@@ -41,6 +41,23 @@ nativeUtils.platformConfigs.each {
|
||||
|
||||
nativeUtils.platformConfigs.linuxathena.linker.args.add("-Wl,--fatal-warnings")
|
||||
|
||||
if (project.hasProperty('ntcoreffibuild')) {
|
||||
// On windows, for ntcoreffi, use static runtime
|
||||
nativeUtils.platformConfigs.each {
|
||||
if (it.name.contains('windows')) {
|
||||
it.cCompiler.releaseArgs.remove('/MD')
|
||||
it.cppCompiler.releaseArgs.remove('/MD')
|
||||
it.cCompiler.debugArgs.remove('/MDd')
|
||||
it.cppCompiler.debugArgs.remove('/MDd')
|
||||
|
||||
it.cCompiler.releaseArgs.add('/MT')
|
||||
it.cppCompiler.releaseArgs.add('/MT')
|
||||
it.cCompiler.debugArgs.add('/MTd')
|
||||
it.cppCompiler.debugArgs.add('/MTd')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
model {
|
||||
components {
|
||||
all {
|
||||
|
||||
Reference in New Issue
Block a user