aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorLong Nguyen <nguyen.long.908132@gmail.com>2020-12-22 00:01:18 +0700
committerGitHub <noreply@github.com>2020-12-21 09:01:18 -0800
commit0e05a1f629c21b9b3ff26fa03e9156bf211d19c3 (patch)
treefe9eafcf6a6a126a8c576d735ff6f16643ade4c7 /scripts
parent05e79e93778622a6f9e3cb8a2362ef6f5df23ec5 (diff)
downloadvcpkg-0e05a1f629c21b9b3ff26fa03e9156bf211d19c3.tar.gz
vcpkg-0e05a1f629c21b9b3ff26fa03e9156bf211d19c3.zip
[mingw] Use find_file to find compiler, fall back to unprefixed windres if the prefixed version doesn't exist (#15179)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/toolchains/mingw.cmake9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/toolchains/mingw.cmake b/scripts/toolchains/mingw.cmake
index 55dc2034d..630a49623 100644
--- a/scripts/toolchains/mingw.cmake
+++ b/scripts/toolchains/mingw.cmake
@@ -21,9 +21,12 @@ foreach(lang C CXX)
set(CMAKE_${lang}_COMPILER_TARGET "${CMAKE_SYSTEM_PROCESSOR}-windows-gnu" CACHE STRING "")
endforeach()
-set(CMAKE_C_COMPILER "${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-gcc.exe" CACHE STRING "")
-set(CMAKE_CXX_COMPILER "${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-g++.exe" CACHE STRING "")
-set(CMAKE_RC_COMPILER "${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-windres.exe" CACHE STRING "")
+find_file(CMAKE_C_COMPILER "${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-gcc.exe")
+find_file(CMAKE_CXX_COMPILER "${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-g++.exe")
+find_file(CMAKE_RC_COMPILER "${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-windres.exe")
+if(NOT CMAKE_RC_COMPILER)
+ find_file(CMAKE_RC_COMPILER "windres.exe")
+endif()
get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
if(NOT _CMAKE_IN_TRY_COMPILE)