From: stevenknight Date: Mon, 28 Feb 2005 00:05:55 +0000 (+0000) Subject: Add support for Objective C/C++ .m and .mm file extensions. (Timothee Besset) X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1dde4b473edcc5e93f3aecd8b26ac1823ac211a2;p=scons.git Add support for Objective C/C++ .m and .mm file extensions. (Timothee Besset) git-svn-id: http://scons.tigris.org/svn/scons/trunk@1236 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/doc/man/scons.1 b/doc/man/scons.1 index d26abdcb..ae57f829 100644 --- a/doc/man/scons.1 +++ b/doc/man/scons.1 @@ -2066,6 +2066,8 @@ Source files must have one of the following extensions: .FOR Fortran file .fpp Fortran file + C pre-processor .FPP Fortran file + C pre-processor + .m Objective C file + .mm Objective C++ file .s assembly language file .S WIN32: assembly language file POSIX: assembly language file + C pre-processor @@ -4930,6 +4932,7 @@ The default list is: [".c", ".C", ".cxx", ".cpp", ".c++", ".cc", ".h", ".H", ".hxx", ".hpp", ".hh", ".F", ".fpp", ".FPP", + ".m", ".mm", ".S", ".spp", ".SPP"] .EE @@ -4975,7 +4978,10 @@ SCons also treats files with the suffixes .IR .c++ , and .I .C++ -as C++ files. +as C++ files, +and files with +.I .mm +suffixes as Objective C++ files. On case-sensitive systems (Linux, UNIX, and other POSIX-alikes), SCons also treats .I .C diff --git a/src/CHANGES.txt b/src/CHANGES.txt index ae196763..4124c7c8 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -25,6 +25,11 @@ RELEASE 0.97 - XXX - Allow Tools found on a toolpath to import Python modules from their local directory. + From Timothee Besset: + + - Add support for Objective C/C++ .m and .mm file suffixes (for + Mac OS X). + From Steve Christensen: - Handle exceptions from Python functions as build actions. diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py index 7010e1c5..d9b1c30e 100644 --- a/src/engine/SCons/Tool/__init__.py +++ b/src/engine/SCons/Tool/__init__.py @@ -55,6 +55,7 @@ SourceFileScanner = SCons.Scanner.Scanner({}, name='SourceFileScanner') CSuffixes = [".c", ".C", ".cxx", ".cpp", ".c++", ".cc", ".h", ".H", ".hxx", ".hpp", ".hh", ".F", ".fpp", ".FPP", + ".m", ".mm", ".S", ".spp", ".SPP"] DSuffixes = ['.d'] diff --git a/src/engine/SCons/Tool/c++.py b/src/engine/SCons/Tool/c++.py index 10bb1ac7..90b01ae8 100644 --- a/src/engine/SCons/Tool/c++.py +++ b/src/engine/SCons/Tool/c++.py @@ -40,7 +40,7 @@ import SCons.Util compilers = ['CC', 'c++'] -CXXSuffixes = ['.cpp', '.cc', '.cxx', '.c++', '.C++'] +CXXSuffixes = ['.cpp', '.cc', '.cxx', '.c++', '.C++', '.mm'] if SCons.Util.case_sensitive_suffixes('.c', '.C'): CXXSuffixes.append('.C') diff --git a/src/engine/SCons/Tool/cc.py b/src/engine/SCons/Tool/cc.py index 56c723dd..8fb9e26f 100644 --- a/src/engine/SCons/Tool/cc.py +++ b/src/engine/SCons/Tool/cc.py @@ -36,7 +36,7 @@ import SCons.Tool import SCons.Defaults import SCons.Util -CSuffixes = ['.c'] +CSuffixes = ['.c', '.m'] if not SCons.Util.case_sensitive_suffixes('.c', '.C'): CSuffixes.append('.C')