From 3337f8b906b7b0c53fbf20099c85bd7d10a4a16c Mon Sep 17 00:00:00 2001 From: David Galiffi Date: Mon, 8 Jul 2024 14:29:40 -0400 Subject: [PATCH] Add CMake Variable TIMEMORY_BINUTILS_DOWNLOAD_URL (#259) * Add CMake Variable TIMEMORY_BINUTILS_DOWNLOAD_URL Used to override the default URL to download BINUTILS from. Useful for internal builds. Also add a mirrors to fallback to if the primary URL fails. Signed-off-by: David Galiffi * Fix CMake linting Signed-off-by: David Galiffi --------- Signed-off-by: David Galiffi --- cmake/Modules/ConfigBinutils.cmake | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cmake/Modules/ConfigBinutils.cmake b/cmake/Modules/ConfigBinutils.cmake index bf4a865ab..cb3ef1efc 100644 --- a/cmake/Modules/ConfigBinutils.cmake +++ b/cmake/Modules/ConfigBinutils.cmake @@ -70,11 +70,21 @@ mark_as_advanced(binutils_CONFIG_FLAGS) # needed for configure command string(REPLACE " " ";" _binutils_CONFIG_FLAGS "${binutils_CONFIG_FLAGS}") +# List of URLS (includes mirrors) to download binutils from. +set(TIMEMORY_BINUTILS_DOWNLOAD_URL + "" + CACHE STRING "URLs for binutils download") + +# Add defualt URLs to download binutils from. +list(APPEND TIMEMORY_BINUTILS_DOWNLOAD_URL + "http://ftpmirror.gnu.org/gnu/binutils/binutils-2.40.tar.gz" + "http://mirrors.kernel.org/sourceware/binutils/releases/binutils-2.40.tar.gz") + include(ExternalProject) externalproject_add( binutils-external PREFIX ${PROJECT_BINARY_DIR}/external/binutils - URL http://ftpmirror.gnu.org/gnu/binutils/binutils-2.40.tar.gz + URL ${TIMEMORY_BINUTILS_DOWNLOAD_URL} BUILD_IN_SOURCE 1 CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env CC=${CMAKE_C_COMPILER} CFLAGS=-fPIC\ -O3