Skip to content

Commit

Permalink
build.gradle: prefer Clang over Visual C++ when compiling on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Feb 2, 2025
1 parent af31e5d commit e82756d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ model {
}

toolChains { // prioritize among the native toolchains
visualCpp(VisualCpp) // used when compiling on Windows
//gcc(Gcc) // to prefer Gcc over Clang
clang(Clang) // the default when compiling on macOS or Linux
//visualCpp(VisualCpp) // to prefer Visual C++ over Clang
//gcc(Gcc) // to prefer Gcc over Clang
clang(Clang) // the default when not cross-compiling
gcc(Gcc)
visualCpp(VisualCpp)

gcc10Arm(Gcc) { // used when cross-compiling on Linux
target('Linux_ARM64') {
Expand Down Expand Up @@ -213,6 +215,9 @@ model {
cppCompiler.args '-fPIC'
cppCompiler.args '-fvisibility=hidden'
linker.args '-fvisibility=hidden'
} else if (os == 'windows') {
cppCompiler.args '-I', "$javaHome/include"
cppCompiler.args '-I', "$javaHome/include/win32"
} else {
buildable = false
}
Expand Down

0 comments on commit e82756d

Please sign in to comment.