Skip to content

Commit

Permalink
Adding option to include debug libs (#72)
Browse files Browse the repository at this point in the history
* Adding option to include debug libs

- Adding env and cli flag to control including debug libs (defaulting to false)
- Updating readme to document the change

* Addressing feedback

---------

Co-authored-by: Scott driggers <[email protected]>
  • Loading branch information
msdrigg and Scott driggers authored Oct 5, 2023
1 parent 9f074e8 commit a8f471c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ for example, `cargo xwin test --target x86_64-pc-windows-msvc`

The Microsoft CRT and Windows SDK can be customized using the following environment variables or CLI options.

| Environment Variable | CLI option | Description |
|----------------------|--------------------|--------------------------------------------------------------------------------------------------------------------|
| `XWIN_ARCH` | `--xwin-arch` | The architectures to include, defaults to `x86_64,aarch64`, possible values: x86, x86_64, aarch, aarch64 |
| `XWIN_VARIANT` | `--xwin-variant` | The variants to include, defaults to `desktop`, possible values: desktop, onecore, spectre |
| `XWIN_VERSION` | `--xwin-version` | The version to retrieve, defaults to 16, can either be a major version of 15 or 16, or a `<major>.<minor>` version |
| `XWIN_CACHE_DIR` | `--xwin-cache-dir` | xwin cache directory to put CRT and SDK files |
| Environment Variable | CLI option | Description |
| ------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `XWIN_ARCH` | `--xwin-arch` | The architectures to include, defaults to `x86_64,aarch64`, possible values: x86, x86_64, aarch, aarch64 |
| `XWIN_VARIANT` | `--xwin-variant` | The variants to include, defaults to `desktop`, possible values: desktop, onecore, spectre |
| `XWIN_VERSION` | `--xwin-version` | The version to retrieve, defaults to 16, can either be a major version of 15 or 16, or a `<major>.<minor>` version |
| `XWIN_CACHE_DIR` | `--xwin-cache-dir` | xwin cache directory to put CRT and SDK files |
| `XWIN_INCLUDE_DEBUG_LIBS` | `--xwin-include-debug-libs` | Whether or not to include debug libs in installation (default false). |

### CMake Support

Expand Down
7 changes: 6 additions & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ pub struct XWinOptions {
/// a "<major>.<minor>" version.
#[arg(long, env = "XWIN_VERSION", default_value = "16", hide = true)]
pub xwin_version: String,

/// Whether or not to include debug libs
#[arg(long, env = "XWIN_INCLUDE_DEBUG_LIBS", hide = true)]
pub xwin_include_debug_libs: bool,
}

impl Default for XWinOptions {
Expand All @@ -59,6 +63,7 @@ impl Default for XWinOptions {
xwin_arch: vec![xwin::Arch::X86_64, xwin::Arch::Aarch64],
xwin_variant: vec![xwin::Variant::Desktop],
xwin_version: "16".to_string(),
xwin_include_debug_libs: false,
}
}
}
Expand Down Expand Up @@ -285,7 +290,7 @@ impl XWinOptions {
.fold(0, |acc, var| acc | *var as u32);
let pruned = xwin::prune_pkg_list(&pkg_manifest, arches, variants, false)?;
let op = xwin::Ops::Splat(xwin::SplatConfig {
include_debug_libs: false,
include_debug_libs: self.xwin_include_debug_libs,
include_debug_symbols: false,
enable_symlinks: !cfg!(target_os = "macos"),
preserve_ms_arch_notation: false,
Expand Down

0 comments on commit a8f471c

Please sign in to comment.