Its due to a single design decision. SCons throws away all environment variables. You must explicitly import the environment variables inside SCons. Which we do for things like JAVA_HOME. The idea is that by isolating the scons from the environment variables you reduce the "it works on my system" situations that result from environment variables that exist on one system and not the other. This also means throwing out everything set by vcvarsall.bat script.
You can manually modify scons to import PATH but vcarsall.bat does more than just add cl.exe to the PATH. So scons will typically still have problems finding some headers and such. I heard that someone was working on updating scons to allow specifying the location of the vcvarsall.bat to import its settings but I am unsure if that ever made it into SCons. George Nash -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Thiago Macieira Sent: Thursday, July 27, 2017 10:58 AM To: [email protected] Subject: Re: [dev] building IoTivity with VS 2017 On Thursday, 27 July 2017 09:35:21 PDT Morten Nielsen wrote: > No it doesn’t. I can write “cl.exe” at the command prompt and that > works, but when I run the scons build right after, it tells me CL can’t be > found. > > If you have 2015 and 2017 installed side by side it does work (From my > understanding, it really uses 2015 regardless of what path you set up > – I’m guessing because the path in the registry is used). That's stupid. Sounds like Scons developers don't really use or test Visual Studio. Everyone with passing familiarity with it for the past 10 or 15 years knows that you the Commant Prompt and the "vcvarsall.bat" script set everything up for you. It's the recommended way to build from the command-line. I should also point out that the Intel compiler comes with another .bat file that sets up the environment so icl.exe works too. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center _______________________________________________ iotivity-dev mailing list [email protected] https://lists.iotivity.org/mailman/listinfo/iotivity-dev _______________________________________________ iotivity-dev mailing list [email protected] https://lists.iotivity.org/mailman/listinfo/iotivity-dev
