cmake add to linker from CLI

CMAKE_EXE_LINKER_FLAGS
CMAKE_MODULE_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS
CMAKE_STATIC_LINKER_FLAGS

https://cmake.org/cmake/help/latest/command/target_link_options.html
https://stackoverflow.com/questions/24532853/how-can-i-add-linker-flag-for-libraries-with-cmake

-DCMAKE_SHARED_LINKER_FLAGS=/DEFAULTLIB:"user32;gdi32;winmm;imm32;ole32;oleaut32;version;uuid;advapi32;setupapi;shell32;dinput8"
-DCMAKE_CXX_STANDARD_LIBRARIES=-lws2_32
posted @ 2023-05-07 12:45  fndefbwefsowpvqfx  阅读(9)  评论(0编辑  收藏  举报