Skip to content

Commit

Permalink
Fix empty CMAKE_CXX_FLAGS_RELEASE if libaom local
Browse files Browse the repository at this point in the history
Fix empty CMAKE_CXX_FLAGS_RELEASE if libaom is built locally using
FetchContent and AVIF_LIBYUV is OFF.

libaom sets CMAKE_CXX_FLAGS_RELEASE and other flags as CACHE variables.
To undo the changes libaom makes, unset the variables as cache variables
so that they can be reset to their original values as normal variables.

Fix #2365.
  • Loading branch information
fdintino authored and wantehchang committed Aug 6, 2024
1 parent c898b5e commit 47f154a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ The changes are relative to the previous release, unless the baseline is specifi

### Changed since 1.1.1
* avifenc: Allow large images to be encoded.
* Fix empty CMAKE_CXX_FLAGS_RELEASE if -DAVIF_CODEC_AOM=LOCAL -DAVIF_LIBYUV=OFF
is specified. https://github.com/AOMediaCodec/libavif/issues/2365.

## [1.1.1] - 2024-07-30

Expand Down
4 changes: 3 additions & 1 deletion cmake/Modules/LocalAom.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ else()
endif()
avif_set_aom_compile_options(aom ${_aom_config})

# Restore the variables.
foreach(_config_setting CMAKE_C_FLAGS CMAKE_CXX_FLAGS CMAKE_EXE_LINKER_FLAGS)
foreach(_config_type DEBUG RELEASE MINSIZEREL RELWITHDEBINFO)
set(${_config_setting}_${_config_type} ${${_config_setting}_${_config_type}_ORIG} CACHE STRING "" FORCE)
unset(${_config_setting}_${_config_type} CACHE)
set(${_config_setting}_${_config_type} ${${_config_setting}_${_config_type}_ORIG})
unset(${_config_setting}_${_config_type}_ORIG)
endforeach()
endforeach()
Expand Down

0 comments on commit 47f154a

Please sign in to comment.