-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1322 from dtolnay/std
Set C++ standard version using cc::Build::std
- Loading branch information
Showing
7 changed files
with
11 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,15 @@ | ||
#[allow(unused_assignments, unused_mut, unused_variables)] | ||
pub const STD: &str = { | ||
let mut flags = ["-std=c++11", "/std:c++11"]; | ||
let mut flag = "c++11"; | ||
|
||
#[cfg(feature = "c++14")] | ||
(flags = ["-std=c++14", "/std:c++14"]); | ||
(flag = "c++14"); | ||
|
||
#[cfg(feature = "c++17")] | ||
(flags = ["-std=c++17", "/std:c++17"]); | ||
(flag = "c++17"); | ||
|
||
#[cfg(feature = "c++20")] | ||
(flags = ["-std=c++20", "/std:c++20"]); | ||
|
||
let [mut flag, msvc_flag] = flags; | ||
|
||
#[cfg(target_env = "msvc")] | ||
(flag = msvc_flag); | ||
(flag = "c++20"); | ||
|
||
flag | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters