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

CMake: correctly detect AOM_USAGE_GOOD_QUALITY #999

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

kleisauke
Copy link
Contributor

aom could be installed in a non-standard prefix, preventing the aom encoder from being used.

Build log before
-- Looking for AOM_USAGE_GOOD_QUALITY
-- Looking for AOM_USAGE_GOOD_QUALITY - not found
Determining if the AOM_USAGE_GOOD_QUALITY exist passed with the following output:
Change Dir: /deps/heif/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake cmTC_aa326/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_aa326.dir/build.make CMakeFiles/cmTC_aa326.dir/build
gmake[1]: Entering directory `/deps/heif/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_aa326.dir/CheckSymbolExists.c.o
/usr/bin/cc   -march=nehalem -Os -fPIC -D_GLIBCXX_USE_CXX11_ABI=1 -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -O3  -fPIE   -o CMakeFiles/cmTC_aa326.dir/CheckSymbolExists.c.o   -c /deps/heif/CMakeFiles/CMakeTmp/CheckSymbolExists.c
In file included from /deps/heif/CMakeFiles/CMakeTmp/CheckSymbolExists.c:2:
/target/include/aom/aom_encoder.h:33:10: fatal error: aom/aom_codec.h: No such file or directory
   33 | #include "aom/aom_codec.h"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
gmake[1]: *** [CMakeFiles/cmTC_aa326.dir/CheckSymbolExists.c.o] Error 1
gmake[1]: Leaving directory `/deps/heif/CMakeFiles/CMakeTmp'
gmake: *** [cmTC_aa326/fast] Error 2


File /deps/heif/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include </target/include/aom/aom_encoder.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef AOM_USAGE_GOOD_QUALITY
  return ((int*)(&AOM_USAGE_GOOD_QUALITY))[argc];
#else
  (void)argc;
  return 0;
#endif
}
Build log after
-- Looking for AOM_USAGE_GOOD_QUALITY
-- Looking for AOM_USAGE_GOOD_QUALITY - found
Determining if the AOM_USAGE_GOOD_QUALITY exist passed with the following output:
Change Dir: /deps/heif/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake cmTC_c75f9/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_c75f9.dir/build.make CMakeFiles/cmTC_c75f9.dir/build
gmake[1]: Entering directory `/deps/heif/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_c75f9.dir/CheckSymbolExists.c.o
/usr/bin/cc  -I/target/include  -march=nehalem -Os -fPIC -D_GLIBCXX_USE_CXX11_ABI=1 -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -O3  -fPIE   -o CMakeFiles/cmTC_c75f9.dir/CheckSymbolExists.c.o   -c /deps/heif/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_c75f9
/usr/bin/cmake3 -E cmake_link_script CMakeFiles/cmTC_c75f9.dir/link.txt --verbose=1
/usr/bin/cc -march=nehalem -Os -fPIC -D_GLIBCXX_USE_CXX11_ABI=1 -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -O3   -L/target/lib -Wl,--gc-sections -Wl,-rpath=$ORIGIN/  CMakeFiles/cmTC_c75f9.dir/CheckSymbolExists.c.o  -o cmTC_c75f9 
gmake[1]: Leaving directory `/deps/heif/CMakeFiles/CMakeTmp'


File /deps/heif/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <aom/aom_encoder.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef AOM_USAGE_GOOD_QUALITY
  return ((int*)(&AOM_USAGE_GOOD_QUALITY))[argc];
#else
  (void)argc;
  return 0;
#endif
}

aom could be installed in a non-standard prefix, preventing the
aom encoder from being used.
@farindk farindk merged commit c7b7d50 into strukturag:master Oct 18, 2023
9 of 30 checks passed
@farindk
Copy link
Contributor

farindk commented Oct 18, 2023

Thanks

@kleisauke kleisauke deleted the cmake-aom-symbol-check branch October 18, 2023 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants