Skip to content
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

Ninja: Windows10 Filename longer than 260 characters #2400

Closed
cctv130 opened this issue Mar 20, 2024 · 7 comments
Closed

Ninja: Windows10 Filename longer than 260 characters #2400

cctv130 opened this issue Mar 20, 2024 · 7 comments

Comments

@cctv130
Copy link

cctv130 commented Mar 20, 2024

Currently using absolute paths causes this error on windows platforms, and the problem still exists.

https://gitlab.kitware.com/cmake/cmake/-/issues/22435

@cctv130
Copy link
Author

cctv130 commented Mar 20, 2024

1710897773511

This error does not exist when I abandon target_link_libraries(test01 ${LLVM_LIBS})

@cctv130
Copy link
Author

cctv130 commented Mar 20, 2024

When I set target test1 to be a static library and not a shared library, the project will compile successfully.

@cristianadam
Copy link
Contributor

Note that the real problem here might be the command line size limitation on Windows. See https://learn.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/command-line-string-limitation

The maximum length of the string that you can use at the command prompt is 8191 characters.

For static libraries lib.exe is called, and for dynamic libraries link.exe is called.

You can check in build.ninja file to see how big the command line for each case is.

@bradking
Copy link
Contributor

Ninja is just running the commands that the generator gives to it. This issue belongs purely on the CMake side, and IMO should be closed here.

@jhasse
Copy link
Collaborator

jhasse commented Mar 20, 2024

for the 260 char problem, see #1900

@jhasse jhasse closed this as completed Mar 20, 2024
@cctv130
Copy link
Author

cctv130 commented Mar 21, 2024

The problem is that cmake got all the dynamic libraries and ninja didn't handle the parameters correctly. If I pass the parameters incorrectly, I get the same error.
1710986676166

@cctv130
Copy link
Author

cctv130 commented Mar 21, 2024

@cristianadam If it is consistent with what you said, then the following error will appear
The command line is too long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants