Skip to content

Commit

Permalink
[infra] Set external mirror server login (Samsung#12103)
Browse files Browse the repository at this point in the history
This commit adds reading environment variable for mirror server login.

ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <[email protected]>
  • Loading branch information
hseok-oh authored Nov 23, 2023
1 parent 8650a6d commit 3f6deff
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions infra/buildtool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,26 @@ endmacro(nnas_include)

nnas_include(OptionTools)
envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com")
# Sync with traditional external download tool: server login
# TODO Migrate external download tool
envoption(EXTERNAL_SERVER_USERPWD "")
if(EXTERNAL_SERVER_USERPWD)
string(REGEX MATCH "^[^:]*" EXTERNAL_SERVER_USERNAME ${EXTERNAL_SERVER_USERPWD})
string(REGEX MATCH "[^:]*$" EXTERNAL_SERVER_PASSWORD ${EXTERNAL_SERVER_USERPWD})
else()
envoption(EXTERNAL_SERVER_USERNAME "")
envoption(EXTERNAL_SERVER_PASSWORD "")
endif()

set(FLATBUFFERS_URL ${EXTERNAL_DOWNLOAD_SERVER}/google/flatbuffers/archive/v2.0.0.tar.gz)

# Download and build Flatbuffers 2.0
include(ExternalProject)
ExternalProject_Add(flatbuffers
URL ${FLATBUFFERS_URL}
DOWNLOAD_NO_EXTRACT TRUE
HTTP_USERNAME ${EXTERNAL_SERVER_USERNAME}
HTTP_PASSWORD ${EXTERNAL_SERVER_PASSWORD}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/flatbuffers
SOURCE_DIR ${NNAS_EXTERNALS_DIR}/FLATBUFFERS-2.0
STAMP_DIR ${NNAS_EXTERNALS_DIR}/external-stamp
Expand Down

0 comments on commit 3f6deff

Please sign in to comment.