Thank you very much, Brad. I found that WINDOWS_EXPORT_ALL_SYMBOLS was set
in my CMakeLists.txt.
After I removed it the /DEF parameter from CMAKE_SHARED_LINKER_FLAGS
appeared in the linking command.
--
Best Regards,
Alexander
On Fri, 8 Nov 2019 at 14:52, Brad King wrote:
> On 11/8/19 5:17 AM,
On 11/8/19 5:17 AM, Alexander wrote:
> /DEF:"E:/workspace/cmake_test_option/tesseract/bin/libtesseract.dir/Release/exports.def"
> is added by CMake automatically and I cannot control it (CMake first creates
> a file
> objects.txt and then exports.def from it).
That behavior is not default, but ac
I am sorry that I did not make it clear from the beginning. You are right.
Not only MSBuild, but MSVC linker (link.exe) accepts only one /DEF
parameter according to
https://docs.microsoft.com/en-us/cpp/build/reference/def-specify-module-definition-file?view=vs-2019
:
"""
The /DEF option passes a mo
On 11/5/19 7:30 AM, Alexander wrote:
> string(APPEND CMAKE_SHARED_LINKER_FLAGS " -DEF:\"foo_1.def\"
> -DEF111:\"foo_1.def\"")
This was the first you've mentioned using more than one copy of the flag.
I tested with this:
```
string(APPEND CMAKE_SHARED_LINKER_FLAGS "
-DEF:\"${CMAKE_CURRENT_SOURC
Well, I have tested this proposal as well and I can confirm that it does
not work for me. I have added this code to my CMakeLists.txt:
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -DEF:\"foo_1.def\"
-DEF111:\"foo_1.def\"")
string(APPEND CMAKE_CXX_STANDARD_LIBRARIES " -DEF:\"foo_2.def\"") # just in
or
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:
```
tar
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 optio
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
Dear CMake Developers,
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.
I already asked in the users-thread, but nobody could answer me directly if
it is bug or not. Original message:
https://cmake.org/pipermail/