CMake: add_definitions -> add_compile_options

`add_definitions` has been superseded by `add_compile_options` and
options added via `add_definitions` can have surprising behavior,
particularly when including `libwebp` as a sub-project via
`FetchContent`.

Change-Id: Icb8478dc92017576028becfd92c4567b4095fa60
This commit is contained in:
Jeremy Maitin-Shepard 2022-10-01 10:35:19 -07:00
parent e68765af42
commit 5ba046e25f

View File

@ -312,7 +312,7 @@ if(MSVC)
# avoid security warnings for e.g., fopen() used in the examples.
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
else()
add_definitions(-Wall)
add_compile_options(-Wall)
endif()
include_directories(${WEBP_DEP_INCLUDE_DIRS})
add_library(webpdecode OBJECT ${WEBP_DEC_SRCS})