问题
Here is my C++ code:
#include<iostream>
int main()
{
std::cout<<"Starting Program"<<std::endl;
int a = 10;
int b = 20;
int c = a + b;
std::cout<<"Sum of A and B is "<<c<<std::endl;
std::cout<<"Ending Program"<<std::endl;
return 0;
}
Here is my SConstruct script file:
env = Environment(platform='sunos')
env.Program('hello.C')
Does above SConstruct file is correct to build hello.C for solaris ? Will this work. Any suggestions.
回答1:
This is how I would do it:
- Setup a Solaris machine x86/SPARC
- Install SCons, GCC, other dependencies
- Set it up as a Jenkins node
I believe SCons will select the GCC toolchain on any non-windows host, so no need for platform='sunos'
environment.
回答2:
No need to specify platform
env = Environment()
env.Program('hello.C')
Should suffice.
It doesn't matter what platform your jenkins is running on, as long as your build worker is on Solaris, SCons will detect that and try to build.
来源:https://stackoverflow.com/questions/64693630/how-to-build-c-code-using-scons-for-solaris-compatible-os-using-jenkins