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

2019-11-11 Thread Alexander
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,

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

2019-11-08 Thread Brad King via cmake-developers
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

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

2019-11-08 Thread Alexander
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

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

2019-11-05 Thread Brad King via cmake-developers
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 "

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

2019-11-05 Thread Alexander
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

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: ```

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

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

2019-10-08 Thread Brad King via cmake-developers
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