Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

clang: warning: argument unused during compilation: '-stdlib=libc++'

Tags:

c++

cmake

I cannot find much information regarding this. What can cause clang to specify this warning?

I have a dev machine which runs a cmake script and everything works fine. The very same cmake file is being executed on a build server the above message is being printed out all the time.

The build server is running clang3.8 while my dev machine is running clang4. I cannot reproduce this problem with a simple solution either. For instance, a simple main.cpp will not cause this error:

clang++ main.cpp -std=c++14 -stdlib=libc++

works just fine even on the build machine.

Any ideas why this might get printed?

This are the flags im using:

set(LIBRARY_RELEASE_OPTIONS "-Wall;-Wextra;-pedantic;-Wlong-long;-Wmissing-braces;-Wunused-function;-Wuninitialized;-Wunused-label;-Wunused-parameter;-Wdisabled-optimization;-O2;-std=c++14;")
add_library(${SHARED_LIBRARY_NAME} STATIC ${SERVER_SOURCE})                                             
target_compile_options(${SHARED_LIBRARY_NAME} PUBLIC "$<$<CONFIG:RELEASE>:${LIBRARY_RELEASE_OPTIONS}>")
like image 769
Crippin Avatar asked Nov 07 '22 14:11

Crippin


1 Answers

The problem seemed to be related to ccache. ccache 3.3.3 works as expected while 3.2.4 on ubuntu 16 LTS seems to cause this warning.

like image 113
Crippin Avatar answered Nov 14 '22 21:11

Crippin