CMAKE removes ".lib" extension when using target_link_libraries

86 views Asked by At

In my project I have something like this:

target_link_directories(my_target PRIVATE
  /path/to/lib
)

target_link_libraries(my_target PRIVATE some_library.lib)

but when I build, the generated link line becomes -lsome_library and linker can not find it because of that. If I put another .lib to it, like this

target_link_libraries(my_target PRIVATE some_library.lib.lib)

then generated link line becomes -lsome_library.lib and linker successfully finds it. I'm on Ubuntu, and compiler/linker I'm using TI's tiarmclang/tiarmlnk.

Is there a way to tell Cmake not to remove .lib suffix. Note that for other suffixes, like .aer5f everything works fine.

0

There are 0 answers