diff --git a/.cargo/config.toml b/.cargo/config.toml index 7b0bfc9..b4178fb 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,15 +1,16 @@ # -Ccontrol-flow-guard: Enable Control Flow Guard, needed for OneBranch's post-build analysis (https://learn.microsoft.com/en-us/cpp/build/reference/guard-enable-control-flow-guard). [target.'cfg(target_os = "windows")'] rustflags = [ + "-Dwarnings", "-Ccontrol-flow-guard", "-Ctarget-feature=+crt-static", - "-Clink-args=/DEFAULTLIB:ucrt.lib /NODEFAULTLIB:vcruntime.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:rpcrt4.lib" + "-Clink-args=/DEFAULTLIB:ucrt.lib /NODEFAULTLIB:vcruntime.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libucrt.lib" ] -# # This fixes the following linker error on x86: -# # error LNK2019: unresolved external symbol _NdrClientCall4 referenced in function ... -# [target.'cfg(all(target_os = "windows", target_arch = "x86"))'] -# rustflags = ["-Clink-args=/DEFAULTLIB:rpcrt4.lib"] +# This fixes the following linker error on x86: +# error LNK2019: unresolved external symbol _NdrClientCall4 referenced in function ... +[target.'cfg(all(target_os = "windows", target_arch = "x86"))'] +rustflags = ["-Clink-args=/DEFAULTLIB:rpcrt4.lib"] # -Clink-args=/DYNAMICBASE /CETCOMPAT: Enable "shadow stack" (https://learn.microsoft.com/en-us/cpp/build/reference/cetcompat) [target.'cfg(all(target_os = "windows", any(target_arch = "x86", target_arch = "x86_64")))'] diff --git a/.github/actions/fix-environment/action.yml b/.github/actions/fix-environment/action.yml index bf7ad3c..5c8ad63 100644 --- a/.github/actions/fix-environment/action.yml +++ b/.github/actions/fix-environment/action.yml @@ -19,18 +19,12 @@ runs: "i686*" { "${env:ProgramFiles(x86)}\Windows Kits\10\bin\10.0.22000.0\x86" >> $env:GITHUB_PATH - - "${env:ProgramFiles(x86)}\Windows Kits\10\Lib\10.0.22000.0\um\x86" >> $env:GITHUB_PATH - ((Resolve-Path "$vs_root\VC\Tools\MSVC\*\bin\Hostx86\x86") | Sort-Object -Descending | Select -First 1).ToString() >> $env:GITHUB_PATH } "x86_64*" { "${env:ProgramFiles(x86)}\Windows Kits\10\bin\10.0.22000.0\x64" >> $env:GITHUB_PATH - - "${env:ProgramFiles(x86)}\Windows Kits\10\Lib\10.0.22000.0\um\x64" >> $env:GITHUB_PATH - ((Resolve-Path "$vs_root\VC\Tools\MSVC\*\bin\Hostx64\x64") | Sort-Object -Descending | Select -First 1).ToString() >> $env:GITHUB_PATH } diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml index c58e389..f089613 100644 --- a/.github/workflows/pr-build.yaml +++ b/.github/workflows/pr-build.yaml @@ -8,9 +8,6 @@ on: branches: - main -env: - RUSTFLAGS: -Dwarnings - jobs: check: runs-on: windows-2022