You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm adding cJSON to a project using CMake version 3.25.2
My project is on a Raspberry Pico microcontroller and I need a static library. In my original CMakeLists.txt, I added set(BUILD_SHARED_LIBS OFF) then add_subdirectory(cJSON).
At building, cmake awared me of an old behavior of option which cleared BUILD_SHARED_LIBS. (cf. CMake CMP0077)
[cmake] CMake Warning (dev) at cJSON/CMakeLists.txt:112 (option):
[cmake] Policy CMP0077 is not set: option() honors normal variables. Run "cmake
[cmake] --help-policy CMP0077" for policy details. Use the cmake_policy command to
[cmake] set the policy and suppress this warning.
[cmake]
[cmake] For compatibility with older versions of CMake, option is clearing the
[cmake] normal variable 'BUILD_SHARED_LIBS'.
[cmake] This warning is for project developers. Use -Wno-dev to suppress it.
I fixed this issue by adding set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) to my parent CMakeLists.txt. However, there is a fix possible directly in cJSON's CMakeLists.txt with cmake_policy(SET CMP0077 NEW).
I'll make a PR, you'll see if it is relevant or not
The text was updated successfully, but these errors were encountered:
Hi,
I'm adding cJSON to a project using CMake version 3.25.2
My project is on a Raspberry Pico microcontroller and I need a static library. In my original CMakeLists.txt, I added
set(BUILD_SHARED_LIBS OFF)
thenadd_subdirectory(cJSON)
.At building, cmake awared me of an old behavior of
option
which clearedBUILD_SHARED_LIBS
. (cf. CMake CMP0077)I fixed this issue by adding
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
to my parent CMakeLists.txt. However, there is a fix possible directly in cJSON's CMakeLists.txt withcmake_policy(SET CMP0077 NEW)
.I'll make a PR, you'll see if it is relevant or not
The text was updated successfully, but these errors were encountered: