Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vcpkg] Add initial s390x support (#12534) #261

Merged
merged 1 commit into from
Jul 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions scripts/buildsystems/vcpkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
1 change: 1 addition & 0 deletions toolsrc/include/vcpkg/base/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace vcpkg::System
X64,
ARM,
ARM64,
S390X,
};

Optional<CPUArchitecture> to_cpu_architecture(StringView arch);
Expand Down
4 changes: 4 additions & 0 deletions toolsrc/src/vcpkg/base/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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");
}
}
Expand All @@ -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
Expand Down
5 changes: 5 additions & 0 deletions triplets/community/s390x-linux.cmake
Original file line number Diff line number Diff line change
@@ -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)