From 6edef9f1f6f425f88009e8d6b81202d7c22a63de Mon Sep 17 00:00:00 2001 From: Long Nguyen Date: Sat, 31 Oct 2020 02:43:59 +0700 Subject: [PATCH] Add compiler executable name into toolchain file (#14269) --- scripts/toolchains/mingw.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/toolchains/mingw.cmake b/scripts/toolchains/mingw.cmake index e61527db10..55dc2034de 100644 --- a/scripts/toolchains/mingw.cmake +++ b/scripts/toolchains/mingw.cmake @@ -21,6 +21,10 @@ 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 "") + get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE ) if(NOT _CMAKE_IN_TRY_COMPILE) string(APPEND CMAKE_C_FLAGS_INIT " ${VCPKG_C_FLAGS} ")