Skip to content

Commit

Permalink
Add cmake -E env to the remaining command_wrapper.
Browse files Browse the repository at this point in the history
  • Loading branch information
FtZPetruska committed Jun 18, 2023
1 parent 4919c51 commit 5d522b0
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 <SOURCE_DIR> && ./autogen.sh COMMAND ${compiler_flags} ${wrapper_command} <SOURCE_DIR>/configure
CONFIGURE_COMMAND cd <SOURCE_DIR> && ./autogen.sh
COMMAND ${CMAKE_COMMAND} -E env ${compiler_flags} ${wrapper_command} <SOURCE_DIR>/configure
--build=${build_native}
--host=${toolchain_host}
--prefix=${toolchain_deps_dir}
Expand All @@ -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} <SOURCE_DIR>/configure
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env ${compiler_flags} ${wrapper_command} <SOURCE_DIR>/configure
--build=${build_native}
--host=${toolchain_host}
--prefix=${toolchain_deps_dir}
Expand Down Expand Up @@ -311,7 +312,7 @@ function(toolchain_deps toolchain_deps_dir toolchain_install_dir toolchain_suffi
patch -d <SOURCE_DIR> -p3 -t -N < ${PROJECT_SOURCE_DIR}/patches/binutils/0001-vita.patch
&& patch -d <SOURCE_DIR> -p1 -t -N < ${PROJECT_SOURCE_DIR}/patches/binutils/0002-fix-broken-reloc.patch
&& patch -d <SOURCE_DIR> -p3 -t -N < ${PROJECT_SOURCE_DIR}/patches/binutils/0003-fix-elf-vaddr.patch
CONFIGURE_COMMAND ${compiler_flags} ${wrapper_command} <SOURCE_DIR>/configure
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env ${compiler_flags} ${wrapper_command} <SOURCE_DIR>/configure
--build=${build_native}
--host=${toolchain_host}
--target=${target_arch}
Expand Down Expand Up @@ -483,7 +484,7 @@ ExternalProject_add(gcc-base
URL_HASH ${GCC_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PATCH_COMMAND patch -d <SOURCE_DIR> -p1 -t -N < ${PROJECT_SOURCE_DIR}/patches/gcc/0001-gcc-10.patch
CONFIGURE_COMMAND ${compiler_flags} ${wrapper_command} <SOURCE_DIR>/configure
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env ${compiler_flags} ${wrapper_command} <SOURCE_DIR>/configure
--build=${build_native}
# compile a native compiler so keep host == build
--host=${build_native}
Expand Down Expand Up @@ -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} <SOURCE_DIR>/configure "CFLAGS_FOR_TARGET=-g -O2 -ffunction-sections -fdata-sections"
--build=${build_native}
--host=${host_native}
Expand All @@ -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}
Expand All @@ -576,7 +577,7 @@ if(CMAKE_TOOLCHAIN_FILE)
URL_HASH ${GCC_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PATCH_COMMAND patch -d <SOURCE_DIR> -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} <SOURCE_DIR>/configure
--build=${build_native}
# compile a native compiler so keep host == build
Expand Down Expand Up @@ -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 <SOURCE_DIR>/platform/vita ${pthread_tools} PREFIX=${CMAKE_INSTALL_PREFIX}
INSTALL_COMMAND $(MAKE) -C <SOURCE_DIR>/platform/vita PREFIX=${CMAKE_INSTALL_PREFIX}/${target_arch} install
# Install into the toolchain directory (required for libgomp target)
Expand All @@ -632,7 +633,7 @@ ExternalProject_add(gcc-final
URL_HASH ${GCC_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PATCH_COMMAND patch -d <SOURCE_DIR> -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} <SOURCE_DIR>/configure
--build=${build_native}
--host=${host_native}
Expand Down

0 comments on commit 5d522b0

Please sign in to comment.