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

Add the host architecture Windows 10 SDK bin directory to the PATH, not the target #524

Merged
merged 1 commit into from
Jul 2, 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
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ jobs:
rust: stable
target: aarch64-apple-ios
no_run: --no-run
- build: windows-aarch64
os: windows-latest
rust: stable
target: aarch64-pc-windows-msvc
no_run: --no-run
- build: win32
os: windows-2016
rust: stable-i686-msvc
Expand Down
8 changes: 8 additions & 0 deletions cc-test/src/aarch64.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
AREA |.text|, CODE, READONLY
GLOBAL |asm|
ALIGN 4
|asm| PROC
mov w0, #7
ret
ENDP
END
14 changes: 11 additions & 3 deletions src/windows_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ mod impl_ {
};

let mut tool = MsvcTool::new(tool_path);
tool.path.push(bin_path.clone());
tool.path.push(host_dylib_path);
tool.libs.push(lib_path);
tool.include.push(include_path);
Expand Down Expand Up @@ -424,8 +425,15 @@ mod impl_ {
let sub = lib_subdir(target)?;
let (ucrt, ucrt_version) = get_ucrt_dir()?;

let host = match host_arch() {
X86 => "x86",
X86_64 => "x64",
AARCH64 => "arm64",
_ => return None,
};

tool.path
.push(ucrt.join("bin").join(&ucrt_version).join(sub));
.push(ucrt.join("bin").join(&ucrt_version).join(host));

let ucrt_include = ucrt.join("include").join(&ucrt_version);
tool.include.push(ucrt_include.join("ucrt"));
Expand All @@ -434,7 +442,7 @@ mod impl_ {
tool.libs.push(ucrt_lib.join("ucrt").join(sub));

if let Some((sdk, version)) = get_sdk10_dir() {
tool.path.push(sdk.join("bin").join(sub));
tool.path.push(sdk.join("bin").join(host));
let sdk_lib = sdk.join("lib").join(&version);
tool.libs.push(sdk_lib.join("um").join(sub));
let sdk_include = sdk.join("include").join(&version);
Expand All @@ -443,7 +451,7 @@ mod impl_ {
tool.include.push(sdk_include.join("winrt"));
tool.include.push(sdk_include.join("shared"));
} else if let Some(sdk) = get_sdk81_dir() {
tool.path.push(sdk.join("bin").join(sub));
tool.path.push(sdk.join("bin").join(host));
let sdk_lib = sdk.join("lib").join("winv6.3");
tool.libs.push(sdk_lib.join("um").join(sub));
let sdk_include = sdk.join("include");
Expand Down