File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -30,12 +30,13 @@ if(CONFIG_NETUTILS_CJSON)
3030 set (CONFIG_NETUTILS_CJSON_VERSION "1.7.10" )
3131 endif ()
3232
33+ # GitHub requires refs/tags/ in the archive URL for tag downloads
3334 if (NOT EXISTS ${CMAKE_CURRENT_LIST_DIR} /cJSON)
3435 FetchContent_Declare(
3536 cJSON
3637 DOWNLOAD_NAME "v${CONFIG_NETUTILS_CJSON_VERSION} .tar.gz"
3738 DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
38- URL "${CONFIG_NETUTILS_CJSON_URL} /v${CONFIG_NETUTILS_CJSON_VERSION} .tar.gz"
39+ URL "${CONFIG_NETUTILS_CJSON_URL} /refs/tags/ v${CONFIG_NETUTILS_CJSON_VERSION} .tar.gz"
3940 SOURCE_DIR
4041 ${CMAKE_CURRENT_LIST_DIR} /cJSON
4142 BINARY_DIR
Original file line number Diff line number Diff line change @@ -49,10 +49,12 @@ CSRCS = $(CJSON_SRCDIR)$(DELIM)cJSON.c
4949CSRCS += $(CJSON_SRCDIR )$(DELIM ) cJSON_Utils.c
5050
5151# Download and unpack tarball if no git repo found
52+ # GitHub requires refs/tags/ in the archive URL for tag downloads (see
53+ # https://docs.github.com/en/repositories/working-with-files/using-files/downloading-source-code-archives)
5254ifeq ($(wildcard $(CJSON_UNPACKNAME ) /.git) ,)
5355$(CJSON_TARBALL ) :
5456 @echo " Downloading: $( CJSON_TARBALL) "
55- $(Q ) curl -O -L $(CONFIG_NETUTILS_CJSON_URL ) /$(CJSON_TARBALL )
57+ $(Q ) curl -O -L $(CONFIG_NETUTILS_CJSON_URL ) /refs/tags/ $(CJSON_TARBALL )
5658
5759$(CJSON_UNPACKNAME ) : $(CJSON_TARBALL )
5860 @echo " Unpacking: $( CJSON_TARBALL) -> $( CJSON_UNPACKNAME) "
You can’t perform that action at this time.
0 commit comments