![]() Usage requirements from linked library targets. ![]() When building libf, ninja only compiles f.cpp, whereas make and vs2019 first builds libd. Specify libraries or flags to use when linking a given target and/or its dependents. When I change CMake a little bit and do something like this: TARGETLINKLIBRARIES (libA libD) TARGETLINKLIBRARIES (exec libA) then linking order is like this: linker -llibA -llibB -llibC -llibD.I only got this working by setting both configurations in one line, as suggested by sakra in a related question - and doing so for every library that needed to be linked. When building exec ninja seems to be able to build a.cpp, b.cpp, and c.cpp in parallel whereas vs2019 does liba, libb and exec in sequence. Somehow the answer from Mike Willekes got CMake linking in the same target both release and debug for me :(.Is there an intended behavior in these cases or is it up to differences in the build systems or bugs? ![]() The value of this property is used by the generators to set the link libraries for the compiler. In addition to accepting values from the targetlinklibraries () command, values may be set directly on any target using the setproperty () command. Also I have observed differences in build order between ninja, make and vs2019. This property specifies the list of libraries or targets which will be used for linking.Why does building libb first build liba? As I understand it liba should just be propagated as a link time dependency to whatever actually links it in ( exec), but I realize I’m missing something. After you used FetchContent, you just need to add the target to the LIBRARIES argument for the cimakexxx macro(s).Given the example CMakeLists.txt file below I have a few questions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |