-
Notifications
You must be signed in to change notification settings - Fork 3
CMake
wizdzz edited this page Nov 15, 2019
·
2 revisions
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--start-group ${YOURFLAG}")
or
target_link_options(${YOUR_TARGET} PRIVATE|PUBLIC|INTERFACE "-Wl,--start-group ${YOURFLAG}")Notice: Linker will go through the input files in order, finding undefined references and satisfying references that it saw before, so if the file that need link appear after the library, then it will occur
undefined reference to xxxerror, add-Wl,--start-groupto tell linker ignore the order; Reference
target_link_optionswill add double quotes to the link command, and sometimes will link failed because of this.
message([<mode>] "message to display")The message is only output for the first time, unless use mode of SEND_ERROR or FATAL_ERROR.
工欲善其事必先利其器;
纸上得来终觉浅,须知此事要躬行;
智者不惑行者无疆;大将无能累死三军;
由简入奢易,由奢入简难;这句话背后藏着的是我们可以戒掉痛苦,但是戒不掉快乐;