0

What needs to be added to the CMakeLists.txt file of the project so that the notelemetry.obj option is appended to the Visual Studio 2019's Linker ->Command Line-> Additional Options field.

notelemetry.obj is not a file, it is an option passed to the linker so that it won't embed data collection logic in your code.

See this if you are interested, my question is how do you pass this option to the linker with cmake?

Vectorizer
  • 1,076
  • 9
  • 24
  • What meaning of this option would be? Do you want to link your executable/library with already created object file? Or what? – Tsyvarev Dec 26 '20 at 21:14
  • @Tsyvarev It is something I have carried over from earlier versions of VS, now would like to put it in cmake. It once was offered as a solution to prevent data collection code being put in the executable. https://stackoverflow.com/questions/37761768/how-to-prevent-visual-studio-2015-update-2-to-add-telemetry-main-invoke-trigger – Vectorizer Dec 27 '20 at 08:08
  • @Tsyvarev I just want that option to appear under the additional options field when I look in the Project Properties->Linker->CommandLine ->Additional Options – Vectorizer Dec 27 '20 at 08:15
  • Oh, so it is just a special option for the linker. You may use [add_link_options](https://cmake.org/cmake/help/latest/command/add_link_options.html) or [target_link_options](https://cmake.org/cmake/help/latest/command/target_link_options.html) for add it. See e.g. that question: https://stackoverflow.com/questions/24532853/how-to-add-linker-flag-for-libraries-with-cmake – Tsyvarev Dec 27 '20 at 10:06
  • @Tsyvarev Thanks add_link_options worked. If you could provide your comment as an answer, I will gladly mark it so. – Vectorizer Dec 27 '20 at 10:17
  • On Stack Overflow we tend to not duplicate answers for different questions. I have linked your question to the one which contains many answers with different approaches for adding linker flags in CMake. – Tsyvarev Dec 27 '20 at 10:24

0 Answers0