Skip to content

Commit 7c3c9f0

Browse files
TrentHoulistonfpistm
authored andcommitted
Wrap cmake policies in an if statement
1 parent ff98229 commit 7c3c9f0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Diff for: cmake/FindArduinoCtags.cmake

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ function(get_ctags)
66

77
# Prevent warnings in CMake>=3.24 regarding ExternalProject_Add()
88
# cf. https://cmake.org/cmake/help/latest/policy/CMP0135.html
9-
cmake_policy(SET CMP0135 OLD)
9+
if (POLICY CMP0135)
10+
cmake_policy(SET CMP0135 OLD)
11+
endif()
1012

1113
cmake_host_system_information(
1214
RESULT HOSTINFO

Diff for: cmake/ensure_core_deps.cmake

+3-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ function(declare_deps CORE_VERSION)
6161

6262
# Prevent warnings in CMake>=3.24 regarding ExternalProject_Add()
6363
# cf. https://cmake.org/cmake/help/latest/policy/CMP0135.html
64-
cmake_policy(SET CMP0135 OLD)
64+
if (POLICY CMP0135)
65+
cmake_policy(SET CMP0135 OLD)
66+
endif()
6567

6668
file(REAL_PATH "${DL_DIR}/package_stmicroelectronics_index.json" JSONFILE)
6769
if (NOT EXISTS ${JSONFILE})

0 commit comments

Comments
 (0)