Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libavif] Can't use static build after 1.1.1 update #42112

Open
jdpurcell opened this issue Nov 11, 2024 · 1 comment
Open

[libavif] Can't use static build after 1.1.1 update #42112

jdpurcell opened this issue Nov 11, 2024 · 1 comment
Assignees
Labels
requires:repro The issue is not currently repro-able

Comments

@jdpurcell
Copy link

CMakeLists.txt:

cmake_minimum_required(VERSION 3.10)
project(HelloWorld)
find_package(libavif CONFIG REQUIRED)
add_executable(HelloWorld helloworld.cpp)
target_link_libraries(HelloWorld PRIVATE avif)

helloworld.cpp:

#include <avif/avif.h>
#include <iostream>

int main() {
    const char* version = avifVersion();
    std::cout << "libavif version: " << version << std::endl;
    return 0;
}

vcpkg.json:

{
  "builtin-baseline": "e60236ee051183f1122066bee8c54a0b47c43a60",
  "overrides": [
    {
      "name": "libavif",
      "version": "1.1.1"
    }
  ],
  "dependencies": [
    {
      "name": "libavif",
      "features": [
        "dav1d"
      ]
    }
  ]
}

When trying to build in macOS results in the following error: helloworld.cpp:1:10: fatal error: 'avif/avif.h' file not found. I believe the same would happen in Linux, but not Windows (didn't try w/ this minimal project but that's what I was seeing with a much larger project that uses libavif), with the difference presumably being that the library is static in macOS/Linux. If the override in vcpkg.json is set to version 1.0.4#2, it works fine.

Comparing the CMake files in vcpkg_installed/arm64-osx/share/libavif from version 1.0.4#2 to 1.1.1 reveals that the following section disappeared:

set_target_properties(avif PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
  INTERFACE_LINK_LIBRARIES "\$<\$<NOT:\$<CONFIG:DEBUG>>:${VCPKG_IMPORT_PREFIX}/lib/libdav1d.a>;\$<\$<CONFIG:DEBUG>:${VCPKG_IMPORT_PREFIX}/debug/lib/libdav1d.a>;\$<LINK_ONLY:yuv>;\$<LINK_ONLY:m>;\$<LINK_ONLY:Threads::Threads>"
)
@WangWeiLin-MV WangWeiLin-MV self-assigned this Nov 12, 2024
@WangWeiLin-MV WangWeiLin-MV added the requires:repro The issue is not currently repro-able label Nov 12, 2024
@dg0yt
Copy link
Contributor

dg0yt commented Nov 13, 2024

This is easily verified. The last update dropped a cmake config patch, but upstream still doesn't export include dirs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requires:repro The issue is not currently repro-able
Projects
None yet
Development

No branches or pull requests

3 participants