cmake: Make wrong vcpkg arch error more clear.
Followup on 49ca52ba
.
Improve the code that shows a fatal error if the vcpkg target
architecture does not match the build environment, by showing both the
target architecture and the build environment architecture.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
parent
49ca52ba03
commit
4e00fa605b
|
@ -17,16 +17,16 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "[xX]86|i[3-9]86|[aA][mM][dD]64")
|
||||||
set(ASM_DEFAULT ON)
|
set(ASM_DEFAULT ON)
|
||||||
set(X86_32 ON)
|
set(X86_32 ON)
|
||||||
set(WINARCH x86)
|
set(WINARCH x86)
|
||||||
|
|
||||||
if(DEFINED VCPKG_TARGET_TRIPLET AND (NOT VCPKG_TARGET_TRIPLET MATCHES "^x86-"))
|
|
||||||
message(FATAL_ERROR "ERROR: Wrong build environment architecture for VCPKG_TARGET_TRIPLET")
|
|
||||||
endif()
|
|
||||||
else()
|
else()
|
||||||
set(AMD64 ON)
|
set(AMD64 ON)
|
||||||
set(WINARCH x64)
|
set(WINARCH x64)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(DEFINED VCPKG_TARGET_TRIPLET AND (NOT VCPKG_TARGET_TRIPLET MATCHES "^x64-"))
|
if(DEFINED VCPKG_TARGET_TRIPLET)
|
||||||
message(FATAL_ERROR "ERROR: Wrong build environment architecture for VCPKG_TARGET_TRIPLET")
|
string(REGEX MATCH "^x[86][64]" target_arch ${VCPKG_TARGET_TRIPLET})
|
||||||
|
|
||||||
|
if(NOT WINARCH STREQUAL target_arch)
|
||||||
|
message(FATAL_ERROR "Wrong build environment architecture for VCPKG_TARGET_TRIPLET, you specified ${target_arch} but your compiler is for ${WINARCH}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue