I’m trying to get CMake to use a custom compiler to build some code. I’ve setup a cmake toolchain file that works great for everything besides linking in static libraries. The linker requires all libraries to be passed using a -library=example.lib,example2.lib. Cmake seems to default to using spaces to separate libraries but this linker won’t take it. Here is my linker call example from my toolchain file:
Yes that would work! I tried figuring it out but my lack of CMake knowledge stopped me. ‘
Is there a method where that would be possible? I figured it was since a lot of libraries are prefaced with “-l” and I would just need to swap that out with “-library=“.
CMake prefers to name libraries by the path to the file on disk. This avoids risk of the linker’s search path containing a conflict. If the -library= flag supports that, try:
Yay! Worked like a charm! Ugh so many options for similar things, I’m sure it makes sense if you understand deeply how CMake works. Looks like I need to do some more research so I can better help myself in the future.
Thank you so much for your help!