1 # SPDX-License-Identifier: MIT
3 # Copyright The SCons Foundation
6 Phony cc command for testing SCons.
8 Copies its source file to the target file, dropping lines that match
9 a pattern, so we can recognize the tool has made a modification.
10 Intended for use as the $CXX construction variable.
12 Note: mycc.py differs from the general fixture file mycompile.py
13 in arg handling: that one is intended for use as a *COM consvar,
14 where no compiler consvars will be passed on, this one is intended
15 for use as $CC, where arguments like -o come into play.
30 if arg
[0] not in '/-':
34 if arg
.startswith('/Fo'):
37 with
open(inf
, 'rb') as infile
, open(out
, 'wb') as outfile
:
39 if not line
.startswith(b
'/*cc*/'):
43 opts
, args
= getopt
.getopt(sys
.argv
[1:], 'co:')
48 with
open(args
[0], 'rb') as infile
, open(out
, 'wb') as outfile
:
50 if not line
.startswith(b
'/*cc*/'):
53 if __name__
== '__main__':
54 print(f
"DEBUG: {sys.argv[0]}: {sys.argv[1:]}")
55 if sys
.platform
== 'win32':