Cataclysm-DDA
Cataclysm-DDA copied to clipboard
Makefile: ignore unused argument warning when linking
Summary
None
Purpose of change
At least on OpenBSD with clang, passing -stdlib=libc++
when linking gives this error:
clang++: error: argument unused during compilation: '-stdlib=libc++' [-Werror,-Wunused-command-line-argument]
Although not passing the argument when linking works on OpenBSD, it does not on Linux with clang and USE_LIBCXX=1
.
Describe the solution
We ignore the warning we might get on BSDs while keeping the argument for systems where it is actually needed.
Describe alternatives you've considered
Not passing -stdlib=libc++
to LDFLAGS
if building on BSDs. However, testing if the behaviour is the same on all other BSDs would be time consuming.
Testing
Successfully built tiles on OpenBSD with clang with this change.
Additional context
This is a continuation of this closed PR: #60208
You could try to figure out if libc++
is used by default with something like
echo 'int main(){}' | clang++ -x c++ - && ldd a.out|grep libc\+\+
and only passing the parameter if it's not.
There is a catch, the ldd
command does not exist on macOS.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.