On Mac OS X, the scons defaults for CC and CXX are gcc and g++, respectively. From Xcode 4.2, these are aliases for clang, which produces some extra warnings and errors when building nsis, eg [#1085] (a workaround of passing APPEND_CCFLAGS=--stdlib=libstdc++ is provided, but this can't be used when cross-compiling plugins etc with MinGW).
Ideally any clang-specific warnings and errors should be fixed, but in the short term and just as a generally useful build feature it would be nice to be able to override CC and CXX on the command-line.
The following patch allows CC and CXX to be specified as build options:
Index: SConstruct =================================================================== --- SConstruct (revision 6510) +++ SConstruct (working copy) @@ -173,6 +173,8 @@ opts.Add(EnumVariable('MSVS_VERSION', 'MS Visual C++ version', os.environ.get('MSVS_VERSION'), allowed_values=('6.0', '7.0', '7.1', '8.0', '8.0Exp', '9.0', '9.0Exp', '10.0', '10.0Exp'))) opts.Add(EnumVariable('TARGET_ARCH', 'Target processor architecture', 'x86', allowed_values=('x86', 'amd64'))) opts.Add(ListVariable('DOCTYPES', 'A list of document types that will be built', default_doctype, doctypes)) +opts.Add(('CC', 'C compiler', None)) +opts.Add(('CXX', 'C++ compiler', None)) opts.Add(PathVariable('APPEND_CPPPATH', 'Additional paths to search for include files', None)) opts.Add(PathVariable('APPEND_LIBPATH', 'Additional paths to search for libraries', None)) opts.Add(('APPEND_CCFLAGS', 'Additional C/C++ compiler flags'))
Thanks. Applied with [r6548].
Related
Commit: [r6548]