Add config/aom_config.h include dir only for AVM config/aom_config.h is a private header, so public headers should not include it. During AVM development, its public headers need to include config/aom_config.h for the definitions of experiment macros. So add the include directory for config/aom_config.h only for AVM.
diff --git a/cmake/Modules/LocalAom.cmake b/cmake/Modules/LocalAom.cmake index 31a622f..4f10019 100644 --- a/cmake/Modules/LocalAom.cmake +++ b/cmake/Modules/LocalAom.cmake
@@ -20,7 +20,7 @@ set_target_properties(aom PROPERTIES IMPORTED_LOCATION "${LIB_FILENAME}" AVIF_LOCAL ON) target_include_directories(aom INTERFACE $<BUILD_INTERFACE:${AOM_EXT_SOURCE_DIR}>) if(AVIF_CODEC_AVM) - # ext/avm/aom/aom_encoder.h includes config/aom_config.h which is generated by the local build of avm. + # avm/aom/aom_encoder.h includes config/aom_config.h which is generated by the local build of avm. target_include_directories(aom INTERFACE $<BUILD_INTERFACE:${AOM_EXT_SOURCE_DIR}/build.libavif>) endif() @@ -185,7 +185,11 @@ endif() set_property(TARGET aom PROPERTY AVIF_LOCAL ON) - target_include_directories(aom INTERFACE $<BUILD_INTERFACE:$<PATH:ABSOLUTE_PATH,${libaom_SOURCE_DIR},/>;${AOM_BINARY_DIR}>) + target_include_directories(aom INTERFACE $<BUILD_INTERFACE:$<PATH:ABSOLUTE_PATH,${libaom_SOURCE_DIR},/>>) + if(AVIF_CODEC_AVM) + # avm/aom/aom_encoder.h includes config/aom_config.h which is generated by the local build of avm. + target_include_directories(aom INTERFACE $<BUILD_INTERFACE:${AOM_BINARY_DIR}>) + endif() message(CHECK_PASS "complete") endif()