Closed UX3D-haertl closed 1 week ago
Is there a specific reason why the inbuilt CMake variable BUILD_SHARED_LIBS is not used to control if KTX is build dynamic or static?
I do not know. I did not write the initial CMake build setup and, as back then I did not know of the existence of CMAKE_BUILD_SHARED_LIBS, the question never came up. The one concern I have with changing to use it is that some other CMake-using projects are included in KTX-Software, e.g, astc-encoder and fmt, for which we want static libraries even when building libktx as a shared library. (Note fmt is only used by the tools but we prefer a static library to minimize the shared libraries we have to wrangle for installation.) Therefore we have to ensure the top-level choice of value is not propagated to those projects. Also some platforms require static libraries. CMAKE_BUILD_SHARED_LIBS must not be allowed to override those.
I would be happy to accept a PR to fix this that is cognizant of the above.
Ping @UX3D-haertl will you provide a PR for this? A release is in the offing so if you have interest now is the time to do it.
Is there a specific reason why the inbuilt CMake variable BUILD_SHARED_LIBS is not used to control if KTX is build dynamic or static?
Using a custom variable makes it harder to integrate with other projects