Open ibell opened 11 years ago
Normally the shell handles the glob and passes emscripten the expanded parameter. It seems windows doesn't do that.
I assume this is a windows limitation, yeah. Perhaps @juj knows better?
I have used file globbing on windows before, so I know its not a limitation with windows. For instance, you can do something like
erase *.obj
to erase all object files
On Sun, Sep 29, 2013 at 8:52 PM, Alon Zakai notifications@github.comwrote:
I assume this is a windows limitation, yeah. Perhaps @jujhttps://github.com/jujknows better?
— Reply to this email directly or view it on GitHubhttps://github.com/kripken/emscripten/issues/1675#issuecomment-25326328 .
Windows shell/cmd.exe does not expand wildcards like Unix systems do. The emscripten compiler will get the string "*.cpp" on the command line inputs. (e.g. http://superuser.com/questions/460598/is-there-any-way-to-get-the-windows-cmd-shell-to-expand-wildcard-paths )
Testing other tools, It looks like at least mingw32-g++.exe and cl.exe (VS2010 compiler) both support the *.cpp wildcard. clang++.exe does not.
To support this, it would be have to be implemented it in emscripten itself.
Ugh. That's too bad. It makes the build process on windows significantly more annoying. I am trying to limit myself to the use of .bat files to limit the dependencies.
On Mon, Sep 30, 2013 at 5:45 PM, juj notifications@github.com wrote:
Windows shell/cmd.exe does not expand wildcards like Unix systems do. The emscripten compiler will get the string "*.cpp" on the command line inputs. (e.g. http://superuser.com/questions/460598/is-there-any-way-to-get-the-windows-cmd-shell-to-expand-wildcard-paths)
Testing other tools, It looks like at least mingw32-g++.exe and cl.exe (VS2010 compiler) both support the *.cpp wildcard. clang++.exe does not.
To support this, it would be have to be implemented it in emscripten itself.
— Reply to this email directly or view it on GitHubhttps://github.com/kripken/emscripten/issues/1675#issuecomment-25374792 .
In case if you or someone else are interested in alternatives at some point, Emscripten has the following support for cross-platform (windows,linux,osx) and cross-target (native,html5) builds:
Also, if you're Windows-only, you can use vs-tool to drive builds from Visual Studio 2010. That gives a nice dropdown dialog to switch between native Windows build and a HTML5 build.
This issue has been automatically marked as stale because there has been no activity in the past 2 years. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.
So, I just got a 5 minute quick and dirty solution to globbing paths in emcc.py that works for me, but I don't know if there'd be issues with other users or when applied to other tools included with emscripten.
The solution I used was to just import the python glob library and intercept the args parameter from the main function, applying globbing to every argument then leaving the argument alone if the result is an empty sequence.
The actual code as it currently looks in my copy of emcc.py is this:
import glob
def glob_args(args):
new_args = []
for i in range(len(args)):
gtable = glob.glob(args[i])
if len(gtable) > 0:
for s in gtable:
new_args.append(s)
else:
new_args.append(args[i])
return new_args
#
# Main run() function
#
def run(args):
args = glob_args(args)
if shared.run_via_emxx:
clang = shared.CLANG_CXX
else:
clang = shared.CLANG_CC
I hope that helps at least somewhat.
I'd be in favor of supporting whatever clang supports. If clang itself doesn't' support such things I don't think we should either.
I'd be in favor of supporting whatever clang supports. If clang itself doesn't' support such things I don't think we should either.
Clang does allow use of glob for input files on windows, emcc gives me this emcc: error: src/*.c: No such file or directory ("src/*.c" was expected to be an input file, based on the commandline arguments provided)
OK, sounds like we should add that support. If you have any time to work an a PR it would be most welcome.
I don't, just sharing this info and that there's some demand
Personally I now use embind via CMake exclusively, in docker containers, so this point is moot for me
On Windows, when I try to use file globs, they don't work. FWIW, file globs work on linux.
Example
yields
so it is clearly not handling the glob properly.