Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang/cmake-rs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.1.51
Choose a base ref
...
head repository: rust-lang/cmake-rs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.1.52
Choose a head ref
  • 8 commits
  • 4 files changed
  • 4 contributors

Commits on Aug 15, 2024

  1. Copy the full SHA
    cdf638f View commit details
  2. Merge pull request #195 from meowtec/feat/improve-fail-hint

    Improve hint for cmake not installed in Linux (code 127)
    tgross35 authored Aug 15, 2024
    Copy the full SHA
    584e1c1 View commit details

Commits on Aug 19, 2024

  1. Change --build to use an absolute path

    We do set the current directory, but it seems that some flavors of CMake
    on Windows still fail with the following:
    
          MSBUILD : error MSB1009: Project file does not exist.  
    
    Change to using an absolute path which should improve this.
    tgross35 committed Aug 19, 2024
    Copy the full SHA
    bbb95e1 View commit details
  2. Merge pull request #200 from tgross35/patch-1

    Change `--build` to use an absolute path
    tgross35 authored Aug 19, 2024
    Copy the full SHA
    a6ed009 View commit details

Commits on Aug 22, 2024

  1. Add a success job to CI

    This will allow us to enable auto merge once CI completes.
    tgross35 committed Aug 22, 2024
    Copy the full SHA
    0c368ee View commit details

Commits on Aug 23, 2024

  1. Merge pull request #218 from tgross35/ci-success

    Add a `success` job to CI
    tgross35 authored Aug 23, 2024
    Copy the full SHA
    b689783 View commit details

Commits on Nov 25, 2024

  1. Copy the full SHA
    3f5d7de View commit details
  2. Copy the full SHA
    2eaa3ba View commit details
Showing with 46 additions and 4 deletions.
  1. +17 −0 .github/workflows/main.yml
  2. +10 −0 CHANGELOG.md
  3. +1 −1 Cargo.toml
  4. +18 −3 src/lib.rs
17 changes: 17 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -137,3 +137,20 @@ jobs:
- uses: Swatinem/rust-cache@v2
- run: cargo doc

success:
needs:
- clippy
- test
- cross_compile_test
- ios_cross_compile_test
- rustfmt
- doc
runs-on: ubuntu-latest
# GitHub branch protection is exceedingly silly and treats "jobs skipped because a dependency
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
# dependencies fails.
if: always() # make sure this is never "skipped"
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: check if any dependency failed
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,16 @@

## [Unreleased]

## [0.1.52](https://github.com/rust-lang/cmake-rs/compare/v0.1.51...v0.1.52) - 2024-11-25

### Other

- Expose cc-rs no_default_flags for hassle-free cross-compilation ([#225](https://github.com/rust-lang/cmake-rs/pull/225))
- Add a `success` job to CI
- Change `--build` to use an absolute path
- Merge pull request [#195](https://github.com/rust-lang/cmake-rs/pull/195) from meowtec/feat/improve-fail-hint
- Improve hint for cmake not installed in Linux (code 127)

## [0.1.51](https://github.com/rust-lang/cmake-rs/compare/v0.1.50...v0.1.51) - 2024-08-15

### Added
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cmake"
version = "0.1.51"
version = "0.1.52"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT OR Apache-2.0"
readme = "README.md"
21 changes: 18 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -77,6 +77,7 @@ pub struct Config {
uses_cxx11: bool,
always_configure: bool,
no_build_target: bool,
no_default_flags: bool,
verbose_cmake: bool,
verbose_make: bool,
pic: Option<bool>,
@@ -184,6 +185,7 @@ impl Config {
path: env::current_dir().unwrap().join(path),
generator: None,
generator_toolset: None,
no_default_flags: false,
cflags: OsString::new(),
cxxflags: OsString::new(),
asmflags: OsString::new(),
@@ -297,6 +299,13 @@ impl Config {
self
}

/// Disables the generation of default compiler flags. The default compiler
/// flags may cause conflicts in some cross compiling scenarios.
pub fn no_default_flags(&mut self, no_default_flags: bool) -> &mut Config {
self.no_default_flags = no_default_flags;
self
}

/// Sets the host triple for this compilation.
///
/// This is automatically scraped from `$HOST` which is set for Cargo
@@ -515,7 +524,7 @@ impl Config {
.debug(false)
.warnings(false)
.host(&host)
.no_default_flags(ndk);
.no_default_flags(ndk || self.no_default_flags);
if !ndk {
c_cfg.target(&target);
}
@@ -527,7 +536,7 @@ impl Config {
.debug(false)
.warnings(false)
.host(&host)
.no_default_flags(ndk);
.no_default_flags(ndk || self.no_default_flags);
if !ndk {
cxx_cfg.target(&target);
}
@@ -846,7 +855,7 @@ impl Config {
}
}

cmd.arg("--build").arg(".");
cmd.arg("--build").arg(&build);

if !self.no_build_target {
let target = self
@@ -1075,6 +1084,12 @@ fn run(cmd: &mut Command, program: &str) {
Err(e) => fail(&format!("failed to execute command: {}", e)),
};
if !status.success() {
if status.code() == Some(127) {
fail(&format!(
"command did not execute successfully, got: {}, is `{}` not installed?",
status, program
));
}
fail(&format!(
"command did not execute successfully, got: {}",
status