<div dir="ltr">Hello,<br><br>I would like to add an extra .defs file for linking of a DLL on 
Windows. I want to use the CMake command line option 
-DCMAKE_SHARED_LINKER_FLAGS="/DEF:my_defs.defs". I expect that besides 
the automatically generated <project_path>/bin/<project>.dir/Release/exports.def i see additionally
/DEF:my_defs.defs
in the resulting linking command, but it does not happen.<br>

<br>

What is especially irritating that CMake deliberately removes namely 
/DEF: from CMAKE_SHARED_LINKER_FLAGS. Any other word combinations (if I 
write  /DEF111:my_defs.def for example) are accepted and I see them the 
linking command.<br>

<br><div>I tried to reach the same goal using a CMakeLists.txt like this:</div><div><pre><code>set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEF:my_defs.def")</code></pre></div>but it did not help - the same way CMake removes my /DEF: option.<br><br>

Could you please open a ticket to fix this behavior to not cut /DEF: option from CMAKE_***_LINKER_FLAGS?<br><div><br>

</div><div>On my opinion CMake should not interpret or modify the content of 
CMAKE_SHARED_LINKER_FLAGS value, but should put it entirely as the user 
specified it. If you have another opinion, please provide any other possibility to pass an arbitrary arguments to the linking command "as is" so that they are not modified.</div><div><br></div>

Any workaround  is highly appreciated (better command-line, because we build 3rd party software and it would not really fine to change CMakeLists.txt)<br><br><div>--</div><div>Best Regards,</div><div>Alexander Samoilov<br></div><div>Build & Integration Engineer<br></div><div>Compart AG, 71034 Böblingen Germany<br></div></div>