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 option to include debug symbols #123

Merged
merged 1 commit into from
Aug 5, 2024
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
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,14 @@ 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 |
| `XWIN_INCLUDE_DEBUG_LIBS` | `--xwin-include-debug-libs` | Whether or not to include debug libs in installation (default false). |
| 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). |
| `XWIN_INCLUDE_DEBUG_SYMBOLS` | `--xwin-include-debug-symbols` | Whether or not to include debug symbols (PDBs) 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 @@ -54,6 +54,10 @@ pub struct XWinOptions {
/// Whether or not to include debug libs
#[arg(long, env = "XWIN_INCLUDE_DEBUG_LIBS", hide = true)]
pub xwin_include_debug_libs: bool,

/// Whether or not to include debug symbols (PDBs)
#[arg(long, env = "XWIN_INCLUDE_DEBUG_SYMBOLS", hide = true)]
pub xwin_include_debug_symbols: bool,
}

impl Default for XWinOptions {
Expand All @@ -64,6 +68,7 @@ impl Default for XWinOptions {
xwin_variant: vec![xwin::Variant::Desktop],
xwin_version: "16".to_string(),
xwin_include_debug_libs: false,
xwin_include_debug_symbols: false,
}
}
}
Expand Down Expand Up @@ -295,7 +300,7 @@ impl XWinOptions {
let pruned = xwin::prune_pkg_list(&pkg_manifest, arches, variants, false, None, None)?;
let op = xwin::Ops::Splat(xwin::SplatConfig {
include_debug_libs: self.xwin_include_debug_libs,
include_debug_symbols: false,
include_debug_symbols: self.xwin_include_debug_symbols,
enable_symlinks: !cfg!(target_os = "macos"),
preserve_ms_arch_notation: false,
use_winsysroot_style: false,
Expand Down
Loading