diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a8b080..13d470d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -284,7 +284,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} @@ -297,7 +298,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} @@ -569,7 +570,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} @@ -583,7 +584,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} @@ -641,7 +642,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)