I started seeing this issue seemingly at random. In order to generate my binaries, this has always evaluated as true:
if (toolChain in VisualCpp)
Now it evaluates false
and if I force it to true with if (true)
, I get this error:
Could not get unknown property 'cppCompiler' for Classes 'main' of type org.gradle.api.internal.jvm.DefaultClassDirectoryBinarySpec.
Here is the full snippet:
/*
* Define compiler and linker arguments
*/
all {
if (toolChain in VisualCpp) {
cppCompiler.args '/FS', '/GS', '/W3', '/Zc:wchar_t', '/Gm-', '/WX-', \
'/fp:precise', '/Zc:forScope', '/Gd', '/EHsc', '/nologo', \
'/IC:/Program Files (x86)/Windows Kits/10/include/10.0.10240.0/ucrt'
cppCompiler.define "_MBCS"
cppCompiler.define "_CRT_SECURE_NO_WARNINGS"
cppCompiler.define "WIN32"
cppCompiler.define "_WINDLL"
cppCompiler.define "APP_BUILDDLL"
linker.args "/MACHINE:X64", "/LIBPATH:C:/Program Files (x86)/Windows Kits/10/Lib/10.0.10240.0/ucrt/x64"
if (buildType == buildTypes.debug) {
cppCompiler.args.addAll(['/Zi', '/Od', '/RTC1', '/MDd'])
linker.args.addAll(['/DEBUG',])
} else {
cppCompiler.args.addAll(['/O2', '/MD'])
}
} else if (toolChain in Gcc) {
cppCompiler.args '-std=gnu++0x'
cppCompiler.define "_GLIBCXX_USE_CXX11_ABI=0"
linker.args '-lstdc++', '-lm'
}
}```
Thanks for any support! =)
Chris