diff options
| author | huangqinjin <huangqinjin@gmail.com> | 2021-04-08 03:41:56 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-07 12:41:56 -0700 |
| commit | 64efdb4658069b8320e6c13638a8b9a141acb8ee (patch) | |
| tree | 287843400cfb77bfafa95561df6275a9e489e1be /scripts/cmake | |
| parent | b3e8d4dc69046c3a9b0aaff9ae9a40aa08d988f1 (diff) | |
| download | vcpkg-64efdb4658069b8320e6c13638a8b9a141acb8ee.tar.gz vcpkg-64efdb4658069b8320e6c13638a8b9a141acb8ee.zip | |
[vcpkg/scripts/make] add compiler tools to PATH (#17085)
* [vcpkg/scripts/make] add compiler tools to PATH
* use find_program to check if tools are already in PATH
Diffstat (limited to 'scripts/cmake')
| -rw-r--r-- | scripts/cmake/vcpkg_configure_make.cmake | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/cmake/vcpkg_configure_make.cmake b/scripts/cmake/vcpkg_configure_make.cmake index 6cccaa341..fb68eeb87 100644 --- a/scripts/cmake/vcpkg_configure_make.cmake +++ b/scripts/cmake/vcpkg_configure_make.cmake @@ -329,13 +329,20 @@ function(vcpkg_configure_make) endmacro()
set(CONFIGURE_ENV "V=1")
- # Remove full filepaths due to spaces (compiler needs to be on path)
+ # Remove full filepaths due to spaces and prepend filepaths to PATH (cross-compiling tools are unlikely on path by default)
set(progs VCPKG_DETECTED_CMAKE_C_COMPILER VCPKG_DETECTED_CMAKE_CXX_COMPILER VCPKG_DETECTED_CMAKE_AR
VCPKG_DETECTED_CMAKE_LINKER VCPKG_DETECTED_CMAKE_RANLIB VCPKG_DETECTED_CMAKE_OBJDUMP
VCPKG_DETECTED_CMAKE_STRIP VCPKG_DETECTED_CMAKE_NM VCPKG_DETECTED_CMAKE_DLLTOOL VCPKG_DETECTED_CMAKE_RC_COMPILER)
foreach(prog IN LISTS progs)
if(${prog})
+ set(path "${${prog}}")
+ unset(prog_found CACHE)
get_filename_component(${prog} "${${prog}}" NAME)
+ find_program(prog_found ${${prog}} PATHS ENV PATH NO_DEFAULT_PATH)
+ if(NOT path STREQUAL prog_found)
+ get_filename_component(path "${path}" DIRECTORY)
+ vcpkg_add_to_path(PREPEND ${path})
+ endif()
endif()
endforeach()
if (_csc_AUTOCONFIG OR _csc_USE_WRAPPERS) # without autotools we assume a custom configure script which correctly handles cl and lib. Otherwise the port needs to set CC|CXX|AR and probably CPP
|
