On Mon, Jun 9, 2025 at 7:32 PM Branko Čibej <br...@apache.org> wrote:

> On 9. 6. 25 19:26, Timofei Zhakov wrote:
>
> On Mon, Jun 9, 2025 at 7:23 PM Branko Čibej <br...@apache.org> wrote:
>
>> On 9. 6. 25 15:41, rin...@apache.org wrote:
>>
>> Author: rinrab
>> Date: Mon Jun  9 13:41:13 2025
>> New Revision: 1926286
>>
>> URL: http://svn.apache.org/viewvc?rev=1926286&view=rev
>> Log:
>> cmake: Generate def files in build time using an external script
>> extractor.cmake script (similarly to extractor.py).
>>
>> * build/cmake/extractor.cmake: New file, with symbol scrapper code.
>> * CMakeLists.txt
>>   (def generator): Generate def files using custom commands and
>>    the extractor.cmake script.
>>
>>
>>
>> Why?  What's the difference, other than you're now spawning another cmake
>> process?
>>
>> -- Brane
>>
>>
> You no longer need to reconfigure the entire project when changing a set
> of public symbols exported from a shared library on windows, which was
> really annoying before, at least for me.
>
>
> I don't understand. You still have to generate the new .def file. How do
> you do that? By invoking extractor.cmake directly?
>
> -- Brane
>
>
I first add a custom build rule for .def files using add_custom_command() and
use these files using target_sources() (which invokes custom build rules
for these files, if any). Using of  add_custom_command() makes it so the
OUTPUT file is not rebuilt as long as the DEPENDS files remain unchanged.

-- 
Timofei Zhakov

Reply via email to