Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to specify -stdlib when using clang++ #923

Open
watiko opened this issue May 13, 2024 · 1 comment
Open

How to specify -stdlib when using clang++ #923

watiko opened this issue May 13, 2024 · 1 comment

Comments

@watiko
Copy link

watiko commented May 13, 2024

It is possible to specify -stdlib by writing the following in poac.toml, but it will not work when CXX=g++.

[profile]
cxxflags = ["-stdlib=libc++"]

I felt it would be useful if there was a way to make it work for both CXX=clang++ and CXX=g++. I'm not sure what the best way is, but I wrote notes of what I came up with.

  • Add CXXFLAGS environment variable (similar to RUSTFLAGS)
  • Allow CXX to be fixed in poac.toml (profile.cxx?) to avoid confusion if only one cxx is assumed.
@ken-matsui
Copy link
Member

@watiko For conditional CXXFLAGS, I think adding cfg works better. For example:

[target.'cfg(compiler = "clang++")'.profile]
cxxflags = ["-stdlib=libc++"]

For fixing CXX to a specific compiler, I am not sure that we should do it. Let me think of it.

ken-matsui pushed a commit that referenced this issue Nov 6, 2024
)

Add support for environment variables `CXXFLAGS` and `LDFLAGS` while
generating Makefile.

See also #923.

---------

Co-authored-by: 27Onion Nebell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants