From: Yonghong Song Date: Sun, 26 Mar 2023 19:38:18 +0000 (-0700) Subject: Set cmake policy for CMP0057 X-Git-Tag: accepted/tizen/unified/20240223.064455~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a791fd102d851557476ceff6a0373ce9ffadae91;p=platform%2Fupstream%2Fbcc.git Set cmake policy for CMP0057 With latest llvm17, running cmake, we got the following errors: -- Found LLVM: /home/yhs/work/llvm-project/llvm/build/install/include 17.0.0git (Use LLVM_ROOT envronment variable for another version of LLVM) CMake Warning (dev) at /home/yhs/work/llvm-project/llvm/build/install/lib/cmake/llvm/LLVM-Config.cmake:230 (if): Policy CMP0057 is not set: Support new IN_LIST if() operator. Run "cmake --help-policy CMP0057" for policy details. Use the cmake_policy command to set the policy and suppress this warning. IN_LIST will be interpreted as an operator when the policy is set to NEW. Since the policy is not set the OLD behavior will be used. Call Stack (most recent call first): cmake/clang_libs.cmake:32 (llvm_map_components_to_libnames) src/cc/CMakeLists.txt:132 (include) This warning is for project developers. Use -Wno-dev to suppress it. CMake Error at /home/yhs/work/llvm-project/llvm/build/install/lib/cmake/llvm/LLVM-Config.cmake:230 (if): if given arguments: "engine" "IN_LIST" "link_components" Unknown arguments specified Let set cmake policy for CMP0057 explicitly. Signed-off-by: Yonghong Song --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 87f85e0d..0c12bfae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,10 @@ if (${CMAKE_VERSION} VERSION_EQUAL 3.12.0 OR ${CMAKE_VERSION} VERSION_GREATER 3. cmake_policy(SET CMP0074 NEW) endif() +if(${CMAKE_VERSION} VERSION_EQUAL 3.3.0 OR ${CMAKE_VERSION} VERSION_GREATER 3.3.0) + cmake_policy(SET CMP0057 NEW) +endif() + project(bcc) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release)