From 5d522b0f761ee260ede1f4c17cb657f89e96d983 Mon Sep 17 00:00:00 2001 From: Pierre Wendling Date: Tue, 6 Jun 2023 23:46:31 -0400 Subject: [PATCH] Add cmake -E env to the remaining command_wrapper. --- CMakeLists.txt | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b97c85a..ba3c51f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -267,7 +267,8 @@ function(toolchain_deps toolchain_deps_dir toolchain_install_dir toolchain_suffi GIT_REPOSITORY https://github.com/Meinersbur/isl GIT_TAG isl-${ISL_VERSION} DOWNLOAD_DIR ${DOWNLOAD_DIR} - CONFIGURE_COMMAND cd && ./autogen.sh COMMAND ${compiler_flags} ${wrapper_command} /configure + CONFIGURE_COMMAND cd && ./autogen.sh + COMMAND ${CMAKE_COMMAND} -E env ${compiler_flags} ${wrapper_command} /configure --build=${build_native} --host=${toolchain_host} --prefix=${toolchain_deps_dir} @@ -280,7 +281,7 @@ function(toolchain_deps toolchain_deps_dir toolchain_install_dir toolchain_suffi URL https://github.com/libexpat/libexpat/releases/download/R_2_3_0/expat-${EXPAT_VERSION}.tar.bz2 URL_HASH ${EXPAT_HASH} DOWNLOAD_DIR ${DOWNLOAD_DIR} - CONFIGURE_COMMAND ${compiler_flags} ${wrapper_command} /configure + CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env ${compiler_flags} ${wrapper_command} /configure --build=${build_native} --host=${toolchain_host} --prefix=${toolchain_deps_dir} @@ -311,7 +312,7 @@ function(toolchain_deps toolchain_deps_dir toolchain_install_dir toolchain_suffi patch -d -p3 -t -N < ${PROJECT_SOURCE_DIR}/patches/binutils/0001-vita.patch && patch -d -p1 -t -N < ${PROJECT_SOURCE_DIR}/patches/binutils/0002-fix-broken-reloc.patch && patch -d -p3 -t -N < ${PROJECT_SOURCE_DIR}/patches/binutils/0003-fix-elf-vaddr.patch - CONFIGURE_COMMAND ${compiler_flags} ${wrapper_command} /configure + CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env ${compiler_flags} ${wrapper_command} /configure --build=${build_native} --host=${toolchain_host} --target=${target_arch} @@ -483,7 +484,7 @@ ExternalProject_add(gcc-base URL_HASH ${GCC_HASH} DOWNLOAD_DIR ${DOWNLOAD_DIR} PATCH_COMMAND patch -d -p1 -t -N < ${PROJECT_SOURCE_DIR}/patches/gcc/0001-gcc-10.patch - CONFIGURE_COMMAND ${compiler_flags} ${wrapper_command} /configure + CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env ${compiler_flags} ${wrapper_command} /configure --build=${build_native} # compile a native compiler so keep host == build --host=${build_native} @@ -544,7 +545,7 @@ ExternalProject_Add(newlib GIT_TAG ${NEWLIB_TAG} ${GIT_SHALLOW_SUPPORT} # Pass the compiler_target_tools here so newlib picks up the fresh gcc-base compiler - CONFIGURE_COMMAND ${compiler_flags} ${toolchain_tools} ${compiler_target_tools} + CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env ${compiler_flag} ${toolchain_tools} ${compiler_target_tools} ${wrapper_command} /configure "CFLAGS_FOR_TARGET=-g -O2 -ffunction-sections -fdata-sections" --build=${build_native} --host=${host_native} @@ -558,7 +559,7 @@ ExternalProject_Add(newlib --enable-newlib-long-time_t --disable-nls --enable-newlib-iconv - BUILD_COMMAND ${compiler_flags} ${toolchain_tools} ${wrapper_command} $(MAKE) + BUILD_COMMAND ${CMAKE_COMMAND} -E env ${compiler_flags} ${toolchain_tools} ${wrapper_command} $(MAKE) INSTALL_COMMAND $(MAKE) install DESTDIR=${CMAKE_INSTALL_PREFIX} # Install a copy of newlib in the toolchain directory (required for pthread-embedded target) COMMAND $(MAKE) install DESTDIR=${toolchain_build_install_dir} @@ -576,7 +577,7 @@ if(CMAKE_TOOLCHAIN_FILE) URL_HASH ${GCC_HASH} DOWNLOAD_DIR ${DOWNLOAD_DIR} PATCH_COMMAND patch -d -p1 -t -N < ${PROJECT_SOURCE_DIR}/patches/gcc/0001-gcc-10.patch - CONFIGURE_COMMAND ${compiler_flags} ${toolchain_tools} + CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env ${compiler_flags} ${toolchain_tools} ${wrapper_command} /configure --build=${build_native} # compile a native compiler so keep host == build @@ -615,7 +616,7 @@ ExternalProject_Add(pthread-embedded # TODO: this project should have a proper makefile to support out-of-source builds BUILD_IN_SOURCE 1 CONFIGURE_COMMAND "" - BUILD_COMMAND ${compiler_flags} ${wrapper_command} $(MAKE) + BUILD_COMMAND ${CMAKE_COMMAND} -E env ${compiler_flags} ${wrapper_command} $(MAKE) -C /platform/vita ${pthread_tools} PREFIX=${CMAKE_INSTALL_PREFIX} INSTALL_COMMAND $(MAKE) -C /platform/vita PREFIX=${CMAKE_INSTALL_PREFIX}/${target_arch} install # Install into the toolchain directory (required for libgomp target) @@ -632,7 +633,7 @@ ExternalProject_add(gcc-final URL_HASH ${GCC_HASH} DOWNLOAD_DIR ${DOWNLOAD_DIR} PATCH_COMMAND patch -d -p1 -t -N < ${PROJECT_SOURCE_DIR}/patches/gcc/0001-gcc-10.patch - CONFIGURE_COMMAND ${compiler_flags} ${toolchain_tools} ${compiler_target_tools} + CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env ${compiler_flags} ${toolchain_tools} ${compiler_target_tools} ${wrapper_command} /configure --build=${build_native} --host=${host_native}