jrl-umi3218 / jrl-cmakemodules

CMake utility toolbox
https://jrl-cmakemodules.readthedocs.io/en/master/
Other
56 stars 46 forks source link

Fix windows template instantiation #654

Closed jorisv closed 5 months ago

jorisv commented 5 months ago

After testing, the first approach is not working.

We must define dllexport when doing the explicit template instantiation definition. We must define dllimport when doing the explicit template instantiation declaration.

I have added @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DECLARATION_DLLEXPORT and @LIBRARY_NAME@_EXPLICIT_INSTANTIATION_DEFINITION_DLLEXPORT to do the job.

Look like another developer had the same conclusion : https://www.reddit.com/r/cpp_questions/comments/111t3zt/comment/j8gwgmp/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button