Skip to content

Commit 24a8ea1

Browse files
Ensure source file is final argument passed to CC and CPP tools (#42)
GCC and Clang both expect to receive the source files being compiled as their final arguments - putting options after them may be an error depending on the semantics of the option. When generating CC and CPP tool commands, ensure `$SRCS_SRCS` (the source file) is the final argument.
1 parent 95b21e4 commit 24a8ea1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: build_defs/cc.build_defs

+1-1
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ def _library_cmds(c, compiler_flags, pkg_config_libs, pkg_config_cflags, extra_f
722722
"""Returns the commands needed for a cc_library rule."""
723723
dbg_flags = _build_flags(compiler_flags, pkg_config_libs, pkg_config_cflags, c=c, dbg=True)
724724
opt_flags = _build_flags(compiler_flags, pkg_config_libs, pkg_config_cflags, c=c)
725-
cmd_template = '$TOOLS_CC -c -I . ${SRCS_SRCS} %s %s'
725+
cmd_template = '$TOOLS_CC -c -I . %s %s ${SRCS_SRCS}'
726726
if archive:
727727
cmd_template += ' && "$TOOLS_ARCAT" ar -r && "$TOOLS_AR" s "$OUT"'
728728
cmds = {

0 commit comments

Comments
 (0)