Skip to content

Commit

Permalink
cli: only replace file ext, not path
Browse files Browse the repository at this point in the history
prevent paths like...

"/my/github.com/path/thing.c"

becoming...

"/my/github.oom/path/thing.o"

when generating build flags for extensions
  • Loading branch information
chrisfarms authored and jwerle committed Jun 30, 2024
1 parent ee338d7 commit 9bd0c81
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/cli/cli.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4377,10 +4377,10 @@ int main (const int argc, const char* argv[]) {
}

auto objectFile = source;
objectFile = replace(objectFile, "\\.mm", ".o");
objectFile = replace(objectFile, "\\.m", ".o");
objectFile = replace(objectFile, "\\.cc", ".o");
objectFile = replace(objectFile, "\\.c", ".o");
objectFile = replace(objectFile, "\\.mm$", ".o");
objectFile = replace(objectFile, "\\.m$", ".o");
objectFile = replace(objectFile, "\\.cc$", ".o");
objectFile = replace(objectFile, "\\.c$", ".o");

auto filename = Path(objectFile).filename();
auto object = (
Expand Down Expand Up @@ -5758,10 +5758,10 @@ int main (const int argc, const char* argv[]) {
}

auto objectFile = source;
objectFile = replace(objectFile, "\\.mm", ".o");
objectFile = replace(objectFile, "\\.m", ".o");
objectFile = replace(objectFile, "\\.cc", ".o");
objectFile = replace(objectFile, "\\.c", ".o");
objectFile = replace(objectFile, "\\.mm$", ".o");
objectFile = replace(objectFile, "\\.m$", ".o");
objectFile = replace(objectFile, "\\.cc$", ".o");
objectFile = replace(objectFile, "\\.c$", ".o");

auto object = Path(objectFile);

Expand Down

0 comments on commit 9bd0c81

Please sign in to comment.