[Scons-users] .C suffix for c files on POSIX

Dirk Bächle tshortik at gmx.de
Thu Dec 19 17:37:39 EST 2013

On 19.12.2013 23:17, Carl Cerecke wrote:

> On 19 December 2013 14:46, Dirk Bächle <tshortik at gmx.de> wrote:

>> Hi Carl,



>> On 19.12.2013 00:49, Carl Cerecke wrote:

>>> How can I tell scons that a .C suffix is for C files, not C++ files on

>>> Linux?


>>> I've tried env.Append(CFILESUFFIX=['.C']) but it does not work - the

>>> files are still recognised as C++.


>> I think that instead of restricting the suffix list, it'd be easier to

>> create an Environment that only loads the C compiler:


>> ccenv = Environment(tools=['cc','link','ar'])


>> and use that one to compile your sources.

> Thanks, Dirk. Good idea. Except the program is a mix of C and C++.


Then compile the C files with "ccenv" and the C++ files with your
"standard" environment...note that you can freely mix and use an
arbitrary number of environments, with differently intialized tools and
variable/path settings, within your SConstructs/SConscripts.



More information about the Scons-users mailing list