Re: using variant_dir but strip out the variant_dir from source files
Jason Kenny <[email protected]>
| Newsgroups | gmane.comp.programming.tools.scons.user |
|---|---|
| Message-ID | <SN2PR01MB204525CE977B7325FA353BB184F60@SN2PR01MB2045.prod.exchangelabs.com> |
Normally SCons will have the compiler output the target data into the Variant directory. In certain cases, the compiler doesn't allow control of where the output happens. SCons has a feature to change the current directory for you. However, this feature as it is, breaks the -j based builds. I work around this in my builds by changing the action to "cd <variant directory> ; <compiler command>". This seems to solve the issue of compilers messing up stuff on disk for me at least. -Jason ________________________________ From: Scons-users <[email protected]> on behalf of Hua Yanghao <[email protected]> Sent: Wednesday, October 17, 2018 2:55 PM To: SCons users mailing list Subject: [Scons-users] using variant_dir but strip out the variant_dir from source files Dear Scons User, I am having maybe an odd request. The background is there are some compilers out there produces all kinds of output in your current directory which you do not have control. I wanted to combine the variant_dir feature plus the chdir kw arguments to builders, to be able to invoke those compilers directly inside the variant_dir. And I still want to keep the source duplication in the variant_dir as it will be a snapshot of only the used files for a particular built out of thousands of irrelevant files. As a side effect now the source files are all prefixed with the variant_dir which becomes "invalid" because the compiler is already invoked in the variant_dir instead of the top level directory. Is there a way (e.g. a special env variable) already that when I write my builders instead of "$COMPILER $SOURCE", I can use something like "$COMPILER $ORIGINAL_SOURCE"? Or do I have to wrap around the $COMPILER with another command such that I can do things like "$COMPILER_WRAPPED $VARIANT_DIR $SOURCE"? I know the second one definitely can work but wondering if there are better ways already in scons. Best Regards, Yanghao _______________________________________________ Scons-users mailing list [email protected] https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpairlist4.pair.net%2Fmailman%2Flistinfo%2Fscons-users&data=02%7C01%7C%7C8f99675c2e4543f7684808d6346a906e%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636754029620286727&sdata=u%2B05v9tFavMUd54jlor3Z41OZrIrITScFekV8MHN7G0%3D&reserved=0 _______________________________________________ Scons-users mailing list [email protected] https://pairlist4.pair.net/mailman/listinfo/scons-users