Add compiler executable name into toolchain file (#14269)

This commit is contained in:
Long Nguyen 2020-10-31 02:43:59 +07:00 committed by GitHub
parent eb8094d4f3
commit 6edef9f1f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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} ")