[vcpkg] Add initial s390x support (#12534)

Signed-off-by: Andrei Lebedev <lebdron@gmail.com>
This commit is contained in:
Andrei Lebedev 2020-07-23 23:16:01 +02:00 committed by GitHub
parent 0896cfcc30
commit 077c0746be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 0 deletions

View File

@ -151,6 +151,8 @@ else()
endif()
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "AMD64")
set(_VCPKG_TARGET_TRIPLET_ARCH x64)
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "s390x")
set(_VCPKG_TARGET_TRIPLET_ARCH s390x)
else()
if( _CMAKE_IN_TRY_COMPILE )
message(STATUS "Unable to determine target architecture, continuing without vcpkg.")

View File

@ -25,6 +25,7 @@ namespace vcpkg::System
X64,
ARM,
ARM64,
S390X,
};
Optional<CPUArchitecture> to_cpu_architecture(StringView arch);

View File

@ -19,6 +19,7 @@ namespace vcpkg
if (Strings::case_insensitive_ascii_equals(arch, "amd64")) return CPUArchitecture::X64;
if (Strings::case_insensitive_ascii_equals(arch, "arm")) return CPUArchitecture::ARM;
if (Strings::case_insensitive_ascii_equals(arch, "arm64")) return CPUArchitecture::ARM64;
if (Strings::case_insensitive_ascii_equals(arch, "s390x")) return CPUArchitecture::S390X;
return nullopt;
}
@ -30,6 +31,7 @@ namespace vcpkg
case CPUArchitecture::X64: return "x64";
case CPUArchitecture::ARM: return "arm";
case CPUArchitecture::ARM64: return "arm64";
case CPUArchitecture::S390X: return "s390x";
default: Checks::exit_with_message(VCPKG_LINE_INFO, "unexpected vcpkg::System::CPUArchitecture");
}
}
@ -51,6 +53,8 @@ namespace vcpkg
return CPUArchitecture::ARM;
#elif defined(__aarch64__) || defined(_M_ARM64)
return CPUArchitecture::ARM64;
#elif defined(__s390x__)
return CPUArchitecture::S390X;
#else // choose architecture
#error "Unknown host architecture"
#endif // choose architecture

View File

@ -0,0 +1,5 @@
set(VCPKG_TARGET_ARCHITECTURE s390x)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)