Re: [cmake-developers] CMake removes /DEF: option in CMAKE_SHARED_LINKER_FLAGS

2019-10-09 Thread Brad King via cmake-developers
On 10/9/19 6:04 PM, Alexander wrote:
> it deliberately ignores /DEF: which makes impossible to add /DEF: this easy
> (and for me preferable) way.

The code

```
string(APPEND CMAKE_SHARED_LINKER_FLAGS " 
-DEF:\"${CMAKE_CURRENT_SOURCE_DIR}/foo.def\"")
```

works fine for me.

So does this:


```
target_link_options(mySharedLib PRIVATE 
"-DEF:${CMAKE_CURRENT_SOURCE_DIR}/foo.def")
```

-Brad
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake-developers


Re: [cmake-developers] CMake removes /DEF: option in CMAKE_SHARED_LINKER_FLAGS

2019-10-09 Thread Alexander
In some cases it is not convenient to program something in CMakeFile.txt
(for example when I clone some 3rd party project and want to change its
build procedure).
Thus the possibility to add additional .defs files with the help of *command
line* options would be very nice. Such a command line option exists:
-DMAKE_SHARED_LINKER_FLAGS, but it deliberately ignores /DEF: which makes
impossible to add /DEF: this easy (and for me preferable) way.

I would like to get an answer from CMake developers, if it is an expected
behavior of  MAKE_SHARED_LINKER_FLAGS.
If yes: what is the logic behind it and why this special handling of
MAKE_SHARED_LINKER_FLAGS is not documented on
https://cmake.org/cmake/help/v3.15/variable/CMAKE_SHARED_LINKER_FLAGS.html.
If no: issue a bug.

--
Best Regards,
Alexander

Do it mean that

On Tue, 8 Oct 2019 at 16:57, Brad King  wrote:

> On 10/8/19 8:10 AM, Alexander wrote:
> > I found that CMake ignores /DEF: option in CMAKE_SHARED_LINKER_FLAGS.
> > I would like to know if this is an expected behaviour or a bug.
>
> A module definition file can be passed as a normal source file and
> CMake will automatically add `/DEF:...` to the link line as needed.
>
> -Brad
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake-developers