Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These changes are designed to produce a more "packagable" set of artifacts suitable for inclusion in a package manager.
Sepcificially, I'd like the add
astcenc
to vcpkg to make it easier to consume for downstream projects, but vcpkg requires conformance to a set of best practices in the libraries that are published there.I could accomplish that conformance through a series of patches that would be equivalent to these changes, but it's preferred to make the changes directly upstream if possible.
The biggest change is that the project no longer builds a static library plus optionally a shared library. Instead it follows the setting specified in BUILD_SHARED_LIBRARIES to build one or the other. Additionally, it no longer forces a value for
MSVC_RUNTIME_LIBRARY
, since for windows builds via vcpkg that's handled automatically via the selection of one of the 3 windows "triplets":x64-windows
,x64-windows-static
andx64-windows-static-md
.Note that vcpkg users will still be able to target specific SIMD ISAs via options. This is an existing package that does something similar.
I've also added the use of CPack configuration files so that downstream packages can integrate this more easily into their projects by calling
find_package(astcenc)
and getting anastcenc::astcenc
imported target that they can use intarget_link_libraries
to get both the library linkage information and the include paths.I've also added a new option called
ASTCENC_LEGACY_NAMING
which defaults to ON. This causes the output binaries to have the same names as the existing CMake config, but explicitly turning it off will cause the project to use base names with ISA or shared/static suffixes.For simplicity and readability I've changed the names of all the targets in the
cmake_core.cmake
file to strings likeastcenc
for the library,veneer
for the CLI lib, andcli
for the CLI executable, then use theOUTPUT_NAME
property to actually control the name of the binary.Here's an example of building and installing with these changes...