mirror of
				https://github.com/google/cpu_features.git
				synced 2025-11-04 06:40:54 +01:00 
			
		
		
		
	Make toolchain persistent accross runs
This commit is contained in:
		@@ -5,6 +5,7 @@ sudo: false
 | 
				
			|||||||
cache:
 | 
					cache:
 | 
				
			||||||
  directories:
 | 
					  directories:
 | 
				
			||||||
    - $HOME/qemu
 | 
					    - $HOME/qemu
 | 
				
			||||||
 | 
					    - $HOME/toolchains
 | 
				
			||||||
 | 
					
 | 
				
			||||||
matrix:
 | 
					matrix:
 | 
				
			||||||
  include:
 | 
					  include:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,7 +14,7 @@ if [[ -n "${CROSS_COMPILE}" ]]; then
 | 
				
			|||||||
  : "${QEMU_ARCH:?Need to set QEMU_ARCH non-empty}"
 | 
					  : "${QEMU_ARCH:?Need to set QEMU_ARCH non-empty}"
 | 
				
			||||||
  ${SCRIPT_FOLDER}/setup_qemu.sh
 | 
					  ${SCRIPT_FOLDER}/setup_qemu.sh
 | 
				
			||||||
  ${SCRIPT_FOLDER}/setup_toolchain.sh
 | 
					  ${SCRIPT_FOLDER}/setup_toolchain.sh
 | 
				
			||||||
  export TOOLCHAIN=${HOME}/${TOOLCHAIN_NAME}
 | 
					  export TOOLCHAIN=${HOME}/toolchains/${TOOLCHAIN_NAME}
 | 
				
			||||||
  export PATH=${TOOLCHAIN}/bin:${HOME}/qemu/bin:${PATH}
 | 
					  export PATH=${TOOLCHAIN}/bin:${HOME}/qemu/bin:${PATH}
 | 
				
			||||||
  export CMAKE_TOOLCHAIN_FILE=cmake/${TARGET}.cmake
 | 
					  export CMAKE_TOOLCHAIN_FILE=cmake/${TARGET}.cmake
 | 
				
			||||||
  if [[ ! -f ${CMAKE_TOOLCHAIN_FILE} ]]; then
 | 
					  if [[ ! -f ${CMAKE_TOOLCHAIN_FILE} ]]; then
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,7 +4,8 @@ set -e
 | 
				
			|||||||
: "${TOOLCHAIN_NAME:?Need to set TOOLCHAIN_NAME non-empty}"
 | 
					: "${TOOLCHAIN_NAME:?Need to set TOOLCHAIN_NAME non-empty}"
 | 
				
			||||||
: "${TARGET:?Need to set TARGET non-empty}"
 | 
					: "${TARGET:?Need to set TARGET non-empty}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [[ -d "$HOME/${TOOLCHAIN_NAME}/${TARGET}" ]] ; then
 | 
					
 | 
				
			||||||
 | 
					if [[ -d "$HOME/toolchains/${TOOLCHAIN_NAME}/${TARGET}" ]] ; then
 | 
				
			||||||
  echo "toolchain ${TOOLCHAIN_NAME} ${TARGET} exists!"
 | 
					  echo "toolchain ${TOOLCHAIN_NAME} ${TARGET} exists!"
 | 
				
			||||||
  exit 0
 | 
					  exit 0
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
@@ -14,7 +15,9 @@ export ARCHIVE_NAME=${TOOLCHAIN_NAME}.tar.xz
 | 
				
			|||||||
echo "TOOLCHAIN: $TOOLCHAIN_NAME"
 | 
					echo "TOOLCHAIN: $TOOLCHAIN_NAME"
 | 
				
			||||||
echo "TARGET   : $TARGET"
 | 
					echo "TARGET   : $TARGET"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cd $HOME
 | 
					mkdir -p $HOME/toolchains
 | 
				
			||||||
 | 
					cd $HOME/toolchains
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test -f "${ARCHIVE_NAME}" || wget https://releases.linaro.org/components/toolchain/binaries/latest/${TARGET}/${ARCHIVE_NAME}
 | 
					test -f "${ARCHIVE_NAME}" || wget https://releases.linaro.org/components/toolchain/binaries/latest/${TARGET}/${ARCHIVE_NAME}
 | 
				
			||||||
tar -xJf ${ARCHIVE_NAME}
 | 
					tar -xJf ${ARCHIVE_NAME}
 | 
				
			||||||
 | 
					rm ${ARCHIVE_NAME}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user