Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion netutils/cjson/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ if(CONFIG_NETUTILS_CJSON)
set(CONFIG_NETUTILS_CJSON_VERSION "1.7.10")
endif()

# GitHub requires refs/tags/ in the archive URL for tag downloads
if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/cJSON)
FetchContent_Declare(
cJSON
DOWNLOAD_NAME "v${CONFIG_NETUTILS_CJSON_VERSION}.tar.gz"
DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
URL "${CONFIG_NETUTILS_CJSON_URL}/v${CONFIG_NETUTILS_CJSON_VERSION}.tar.gz"
URL "${CONFIG_NETUTILS_CJSON_URL}/refs/tags/v${CONFIG_NETUTILS_CJSON_VERSION}.tar.gz"
SOURCE_DIR
${CMAKE_CURRENT_LIST_DIR}/cJSON
BINARY_DIR
Expand Down
4 changes: 3 additions & 1 deletion netutils/cjson/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ CSRCS = $(CJSON_SRCDIR)$(DELIM)cJSON.c
CSRCS += $(CJSON_SRCDIR)$(DELIM)cJSON_Utils.c

# Download and unpack tarball if no git repo found
# GitHub requires refs/tags/ in the archive URL for tag downloads (see
# https://docs.github.com/en/repositories/working-with-files/using-files/downloading-source-code-archives)
ifeq ($(wildcard $(CJSON_UNPACKNAME)/.git),)
$(CJSON_TARBALL):
@echo "Downloading: $(CJSON_TARBALL)"
$(Q) curl -O -L $(CONFIG_NETUTILS_CJSON_URL)/$(CJSON_TARBALL)
$(Q) curl -O -L $(CONFIG_NETUTILS_CJSON_URL)/refs/tags/$(CJSON_TARBALL)

$(CJSON_UNPACKNAME): $(CJSON_TARBALL)
@echo "Unpacking: $(CJSON_TARBALL) -> $(CJSON_UNPACKNAME)"
Expand Down
Loading