Joe232
October 4, 2021, 7:12am
1
Hi, I am having a bit of trouble, on Windows 10 I tried to run
RUSTFLAGS="-C target-cpu=native" cargo build --release
but this wouldn't even work as RUSTFLAGS does not exist.
I tried to add this in the cargo.toml
file:
[build]
rustflags = "-C target-cpu=native"
and when I did run cargo build --release
I get this warning message:
warning: unused manifest key: build
So how would I just be able to build an application natively for my CPU for Windows 10?
Hyeonu
October 4, 2021, 7:20am
2
What's the warning message? Also, FOO="bar" command
is a bash syntax to pass environment variables to the command. Which shell are you using? cmd.exe
or PowerShell?
Joe232
October 4, 2021, 7:22am
3
I just fixed it, it was poorly formatted for markdown.
I am using cmd.exe
Hyeonu
October 4, 2021, 7:29am
4
You need the set command to set environment variables on cmd.exe
Or you can specify rustflags = [...]
within the cargo config , not in the cargo manifest(Cargo.toml
)
3 Likes
system
Closed
January 2, 2022, 7:30am
5
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.