-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The caret character is a special in cmd.exe on Windows #580
Comments
The reason I didn't use a command-line option in the first place is because (in theory) you could do something like Is there a different character on Windows that will make it through, but that doesn't often exist in filenames? |
Maybe some prefix would work, like "output:foo.cc" |
@martine, personally I don't mind losing the ability of mixing normal target and the output(^) on the same command line. But if you are looking for a new special charater, cmd's help doc says the following special characters require quotes, &()[]{}^=;!'+,`~ and . Perhaps we can use "@"? This is a valid char for file names on both windows and linux, but I suppose it's not often used. |
@file is often used for "response file" though, to put long command line switches into a file, and thus work-around CLI limitations of some shells. |
@ddevienne, yes, but this should not prevent ninja taking path/to/foo.cpp@ as a command line argument. As far as I know, ninja does not pass foo.cpp@ to any of the build actions. |
The caret character (^) is a great feature of ninja, which allows one to build the object file specifying only the source file. However, as it is a special character in cmd.exe, it is very awkward to use on Windows. One has to 2 carets when invoking ninja on Windows cmd windows. And the number of carets have to be doubled or redoubled depending on how many levels of system() call (or cmd.exe invocation) are involved. In our case, we have a wrapper program, which runs ninja either locally or through the Incredibuild engine, so we have to use 4 or 8 carets characters.
It would be great if another character can be chose for this feature, or better yet, create a command line option for this.
The text was updated successfully, but these errors were encountered: