Skip to content

Commit

Permalink
Merge pull request #66 from jkawamoto/cstd
Browse files Browse the repository at this point in the history
Improve the build script
  • Loading branch information
jkawamoto committed Jun 30, 2024
2 parents 74d0f5d + ec83087 commit d5a336f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 0 additions & 3 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[env]
CXXFLAGS = "-std=c++17"

[target.'cfg(target_os = "windows")']
rustflags = ["-C", "target-feature=+crt-static"]
4 changes: 3 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v3
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/checkout@v4
- uses: dprint/check@v2.2
- uses: pre-commit/action@v3.0.1
Expand Down
6 changes: 3 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ fn main() {

let mut cmake = Config::new("CTranslate2");
cmake
.static_crt(true)
.define("BUILD_CLI", "OFF")
.define("BUILD_SHARED_LIBS", "OFF")
.define("WITH_MKL", "OFF")
Expand All @@ -49,7 +48,7 @@ fn main() {
}

println!("cargo::rustc-link-arg=/FORCE:MULTIPLE");
cmake.profile("Release");
cmake.profile("Release").cxxflag("/EHsc").static_crt(true);
}

if cfg!(feature = "cuda") {
Expand Down Expand Up @@ -90,7 +89,8 @@ fn main() {
.file("src/generator.cpp")
.include("CTranslate2/include")
.std("c++17")
.static_crt(true)
.static_crt(cfg!(target_os = "windows"))
.flag_if_supported("/EHsc")
.compile("ct2rs");
}

Expand Down

0 comments on commit d5a336f

Please sign in to comment.