Backslash convertion in cmake link flags
See original GitHub issueAs reported in https://github.com/conan-io/conan/issues/813 by @SSE4
With the glew package:
19>LINK : fatal error LNK1104: cannot open file '\NODEFAULTLIB:LIBCMTD \NODEFAULTLIB:LIBCMT.obj'
digging down suggests that it’s most likely from glew package which defines:
if self.settings.compiler.runtime != "MT":
self.cpp_info.exelinkflags.append('/NODEFAULTLIB:LIBCMTD')
self.cpp_info.exelinkflags.append('/NODEFAULTLIB:LIBCMT')
and somehow slash got converted into backslash somewhere. inspecting conanbuildinfo.cmake I can see just the following:
set(CONAN_EXE_LINKER_FLAGS_GLEW "/NODEFAULTLIB:LIBCMTD /NODEFAULTLIB:LIBCMT")
if anyone will encounter the same issue - I’ve applied workaround to the glew receipt to use dash rather slash, so it is:
if self.settings.compiler.runtime != "MT":
self.cpp_info.exelinkflags.append('-NODEFAULTLIB:LIBCMTD')
self.cpp_info.exelinkflags.append('-NODEFAULTLIB:LIBCMT')
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
CMake 3.20.0 cannot handle backslashes in CFLAGS
Code in CMake should be converting externally-retrieved paths into forward slashes before processing them further. Please git bisect to find the ...
Read more >cmake-generator-expressions(7)
For example, slashes are converted to backslashes in Windows shells and drive letters ... This expression may be used to specify compile options,...
Read more >cmake_path — CMake 3.25.1 Documentation
Converts a cmake-style <input> path into a native path with platform-specific slashes ( \ on Windows hosts and / elsewhere). The input can...
Read more >[cmake-developers] generator expression for path slash ...
[cmake-developers] generator expression for path slash conversion · Previous message: [cmake-developers] Add command line options for deprecation message control ...
Read more >[cmake-developers] generator expression for path slash ...
I would suggest that I add another output flag to > cmOutputConverter like SHELL_NO_ESCAPE then. If this flag is passed to > ConvertToOutputFormat()...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@memsharded hi, yeah, I have changes besides -DNODEFAULTLIB. lemme check with conan 0.19.1 and original glew repo, I will reply afterwards.
Ok, great, thanks for telling. Then I am labeling as fixed and closing the issue, please re-open if this happens again.