Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

Commit

Permalink
Preserve -Xarch_<arch> context when filtering args
Browse files Browse the repository at this point in the history
  • Loading branch information
jacknagel committed May 6, 2014
1 parent 400e6a3 commit c7409f3
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Library/ENV/4.3/cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,18 @@ class Cmd
enum = @args.each

loop do
args += refurbish_arg(enum.next, enum)
case arg = enum.next
when "-arch"
enum.next
when /^-Xarch_/
refurbished = refurbish_arg(enum.next, enum)
unless refurbished.empty?
args << arg
args += refurbished
end
else
args += refurbish_arg(arg, enum)
end
end

args
Expand All @@ -135,8 +146,6 @@ class Cmd
args = []

case arg
when '-arch', /^-Xarch_/
enum.next
when '-m32'
# If ENV.m32 was set, we allow the "-m32" flag, but we don't add anything
args << '-m32' if cccfg? '3'
Expand Down

2 comments on commit c7409f3

@GuillaumeDIDIER
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fixe, and a lot more elegant than what I had tried some time ago. (I had added an arch variable to keep track of Xarched args and I had to test that each time an argument as added)
PS Sorry for having trolled in #28929.

@MikeMcQuaid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats ok @GuillaumeDIDIER, I don't think I ever fully understood your change until now. Glad it's fixed for both of us!

Please sign in to comment.