FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
assert_cmd/build.rs at master · assert-rs/assert_cmd · GitHub
assert-rs
/
assert_cmd
Public
Notifications
You must be signed in to change notification settings
Fork
48
Star
563
Code
Issues
24
Pull requests
3
Discussions
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
assert_cmd
/
build.rs
Copy path
More file actions
More file actions
Latest commit
History
History
History
17 lines (15 loc) · 674 Bytes
Breadcrumbs
assert_cmd
/
build.rs
Copy path
File metadata and controls
17 lines (15 loc) · 674 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use
std
::
env
;
use
std
::
fs
;
use
std
::
io
::
Write
;
use
std
::
path
;
fn
main
(
)
{
println
!
(
"cargo:rerun-if-changed=build.rs"
)
;
// env::ARCH doesn't include the full triplet, and as far as I know there isn't a cleaner way of getting the full triplet
// (see cargo.rs for the rest of this implementation)
let
out = path
::
PathBuf
::
from
(
env
::
var_os
(
"OUT_DIR"
)
.
expect
(
"run within cargo"
)
)
.
join
(
"current_target.txt"
)
;
let
default_target = env
::
var
(
"TARGET"
)
.
expect
(
"run as cargo build script"
)
;
let
mut
file = fs
::
File
::
create
(
out
)
.
expect
(
"can write to OUT_DIR"
)
;
file
.
write_all
(
default_target
.
as_bytes
(
)
)
.
expect
(
"can write to OUT_DIR"
)
;
}
Back
|
FazBrowse Home
|
New Git URL