Allow using the search path from -resource-dir with emcc -print-file-name#27082
Conversation
|
Can you share the exact command line that cmake is using to ask for this path? I don't think this change should be necessary but perhaps I don't understand. |
|
I think all we need to do here is make sure that If you install |
Hopefully prevents the CI fail
It usually just runs execute_process(
COMMAND
"${CMAKE_CXX_COMPILER}"
${CMAKE_CXX_COMPILER_ID_ARG1}
-print-file-name=libc++.modules.json
...CMAKE_CXX_COMPILER_ID_ARG1 can be used here to add more flexibility. But yeah we probably should build and install the files properly anyways. Not too familiar with how |
This reverts the initial changes in favor of -resource-dir
|
|
||
| resource_dir = [a for a in args if a.startswith(('-resource-dir=', '--resource-dir='))] | ||
| if resource_dir: | ||
| resource_dir = resource_dir[-1].split('=')[1] |
There was a problem hiding this comment.
Can you move this lines inside the if print_file_name block?
Then you can do something like this:
resource_dir_args = [a for a in args if a.startswith(('-resource-dir=', '--resource-dir='))]
if resource_dir_args:
resource_dir = resource_dir_args[-1].split('=')[1]
else:
resource_dir = cache.get_lib_dir(absolute=True)
fullpath = os.path.join(resource_dir, libname)
|
|
||
| @crossplatform | ||
| def test_print_file_name_with_resource_dir(self): | ||
| output = self.run_process([EMCC, '-print-file-name=emcc'], stdout=PIPE).stdout |
There was a problem hiding this comment.
Can you change this to emcc.py. The file emcc only exists on UNIX. On windows its called emcc.exe. But emcc.py always exists.
68b261a to
e0f8ab0
Compare
|
Can you update the PR title and description. This is really about adding support for Its not really specific to cmake and IIRC we don't want to be passing a custom -resource-dir in #27065 do we? |
emcc -print-file-nameemcc -print-file-name
Yeah but this can be used when testing until we have code to install the files propery |
This allows emcc to change the search path when running it like:
emcc -resource-dir=... -print-file-name=...which mimics the upstream clang behavior.