Skip to content

Commit 3932965

Browse files
ephphathaAJenbo
authored andcommitted
use built-in cmake options when building with newer cmake
1 parent 919cead commit 3932965

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

3rdParty/libzt/CMakeLists.txt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@ set(BUILD_HOST_SELFTEST OFF)
44
set(LWIP_FLAGS "-DLWIP_IPV6_FORWARD=1")
55

66
include(FetchContent)
7-
FetchContent_Declare(libzt
8-
GIT_REPOSITORY https://github.com/diasurgical/libzt.git
9-
GIT_TAG 72a518bcf7d87e32f718ca612ce2c8303ceedd12)
10-
FetchContent_MakeAvailableExcludeFromAll(libzt)
7+
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.28.0")
8+
FetchContent_Declare(libzt
9+
GIT_REPOSITORY https://github.com/diasurgical/libzt.git
10+
GIT_TAG 72a518bcf7d87e32f718ca612ce2c8303ceedd12
11+
EXCLUDE_FROM_ALL)
12+
FetchContent_MakeAvailable(libzt)
13+
else()
14+
FetchContent_Declare(libzt
15+
GIT_REPOSITORY https://github.com/diasurgical/libzt.git
16+
GIT_TAG 72a518bcf7d87e32f718ca612ce2c8303ceedd12)
17+
FetchContent_MakeAvailableExcludeFromAll(libzt)
18+
endif()
1119

1220
if(NOT ANDROID)
1321
set(libzt_LIB_NAME zt-static)

0 commit comments

Comments
 (0)