I need vs project to have commandline option as /ENTRY:"mainCRTStartup". To achieve need to know the cmake commands. Could you please let me know what all cmake changes to achieve this.
Asked
Active
Viewed 109 times
0
-
VS->Configuration Properties->Linker->Command Line – deepak dhanvantri Dec 12 '17 at 08:21
-
Possible duplicate of [Passing compiler options cmake](https://stackoverflow.com/questions/44284275/passing-compiler-options-cmake) – Florian Dec 12 '17 at 10:48
1 Answers
0
You would need to use the set_target_properties() function to add the ENTRY link flag.
set_target_properties(target PROPERTIES LINK_FLAGS "/ENTRY:\"mainCRTStartup\"" ...)
A lot of people trnd to forget about escaping the quotes around mainCRTStartup. Note: The "..." symbolizes any additional link flags you'd like to set. If you have additional link flags, wrap the quotes around all the link flags together.
This should typically be done after your add_executable/add_library call.

Chris
- 2,254
- 8
- 22