I need to change the name and path of a GCC compiler. I am using a real-time compiler from National Instruments, a GCC clone. I have found a way to force a new path with
plugins {
id 'cpp-library'
}
library {
linkage = [Linkage.STATIC]
targetMachines.add(machines.windows.x86_64)
targetMachines.add(machines.linux.x86_64)
model {
toolChains {
gcc(Gcc) {
path 'C:\\Users\\....\\CRIOCompiler23Q4\\oecore-x86_64-core2-64-toolchain\\sysroots\\x86_64-w64-mingw32\\usr\\bin\\x86_64-nilrt-linux'
}
}
}
}
I get the following error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task 'compileDebugCpp'.
> Error while evaluating property 'compilerVersion' of task 'compileDebugCpp'.
> No tool chain is available to build C++ for host operating system 'Windows 10' architecture 'x86-64':
- Tool chain 'gcc' (GNU GCC):
- Could not find C++ compiler 'g++'. Searched in:
- C:\Users\n24090\CRIOCompiler23Q4\oecore-x86_64-core2-64-toolchain\sysroots\x86_64-w64-mingw32\usr\bin\x86_64-nilrt-linux
Now I need to change the name of the compiler from ‘g++’ to ‘x86_64-nilrt-linux-g++.exe’. I have tried
plugins {
id 'cpp-library'
}
library {
linkage = [Linkage.STATIC]
targetMachines.add(machines.windows.x86_64)
model {
toolChains {
gcc(Gcc) {
path 'C:\\Users\\n24090\\CRIOCompiler23Q4\\oecore-x86_64-core2-64-toolchain\\sysroots\\x86_64-w64-mingw32\\usr\\bin\\x86_64-nilrt-linux'
cCompiler.executable 'x86_64-nilrt-linux-gcc.exe'
cppCompiler.executable 'x86_64-nilrt-linux-g++.exe'
assembler.executable 'x86_64-nilrt-linux-as.exe'
linker.executable 'x86_64-nilrt-linux-ld.exe'
}
}
}
}
Which returns the following error
FAILURE: Build failed with an exception.
* Where:
Build file 'build.gradle' line: ...
* What went wrong:
A problem occurred configuring project '...'.
> Failed to notify project evaluation listener.
> Exception thrown while executing model rule: model.toolChains
> Could not get unknown property 'cCompiler' for Tool chain 'gcc' (GNU GCC) of type org.gradle.nativeplatform.toolchain.internal.gcc.GccToolChain.
> Exception thrown while executing model rule: model.toolChains
> Could not get unknown property 'cCompiler' for Tool chain 'gcc' (GNU GCC) of type org.gradle.nativeplatform.toolchain.internal.gcc.GccToolChain.
I am hoping this is a relatively simple change.
Thanks for any help.