sw:vec_iree: Use wget instead of download_url.py in CMake
Change-Id: I58e89fbad764dff53231c7345cecdaa388bdc3e9
diff --git a/build_tools/download_url.py b/build_tools/download_url.py
deleted file mode 100755
index e8aa650..0000000
--- a/build_tools/download_url.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python3
-"""Download file from URL."""
-import argparse
-import urllib.request
-
-args = parser = argparse.ArgumentParser(
- description='Download files from URL.')
-parser.add_argument('--u', dest='img_url', required=True,
- help='Input image URL')
-parser.add_argument('--o', dest='output_file',
- help='Output binary name', required=True)
-args = parser.parse_args()
-
-if __name__ == '__main__':
- urllib.request.urlretrieve(args.img_url, args.output_file)
diff --git a/cmake/iree_model_input.cmake b/cmake/iree_model_input.cmake
index bb28d37..f9e09ca 100644
--- a/cmake/iree_model_input.cmake
+++ b/cmake/iree_model_input.cmake
@@ -36,17 +36,15 @@
string(REGEX MATCH "^https:" _RULE_SRC_URL ${_RULE_SRC_TRIM})
if (_RULE_SRC_URL)
get_filename_component(_INPUT_FILENAME "${_RULE_SRC}" NAME)
- set(_ARGS)
- set(_DOWNLOAD_SCRIPT "${CMAKE_SOURCE_DIR}/build_tools/download_url.py")
- list(APPEND _ARGS "--u=${_RULE_SRC_TRIM}")
- list(APPEND _ARGS "--o=${_INPUT_FILENAME}")
+ find_program(_WGET wget HINT "$ENV{PATH}" REQUIRED)
add_custom_command(
OUTPUT
${_INPUT_FILENAME}
COMMAND
- ${_DOWNLOAD_SCRIPT} ${_ARGS}
- DEPENDS
- ${_DOWNLOAD_SCRIPT}
+ ${_WGET} -q -P "${CMAKE_CURRENT_BINARY_DIR}" -O "${_INPUT_FILENAME}"
+ "${_RULE_SRC_TRIM}"
+ COMMENT
+ "Download ${_INPUT_FILENAME} from ${_RULE_SRC_TRIM}"
)
else()
set(_INPUT_FILENAME ${_RULE_SRC_TRIM})