Description
Currently compilation flags are not correctly propagated to all third-party dependencies, because in many of these cases, we shell out to `configure` and `make` on Unix, without propagating the correct flags and configuration we're using for the rest of the build.
For example, if you request to compile Mesos with clang:
cmake -DCMAKE_C_COMPILER=clang-3.6 -DCMAKE_CXX_COMPILER=clang++-3.6 -DCMAKE_BUILD_TYPE=Release ..
we end up with a bunch of lines like:
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I/home/joris/projects/mesos/cmake-build/3rdparty/protobuf-2.6.1/src/protobuf-2.6.1/src/../src -I.. -pthread -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -O2 -g -DNDEBUG -MT google/protobuf/compiler/command_line_interface.lo -MD -MP -MF google/protobuf/compiler/.deps/command_line_interface.Tpo -c /home/joris/projects/mesos/cmake-build/3rdparty/protobuf-2.6.1/src/protobuf-2.6.1/src/../src/google/protobuf/compiler/command_line_interface.cc -o google/protobuf/compiler/command_line_interface.o >/dev/null 2>&1
A better solution is probably to use a CMake-based build system for these dependencies, or at least propagate important flags to `configure`.
Another possibility is that it actually is desired behavior to compile with GCC in this case. If that's true, we should develop good reasons, add them to the comments, and close this issue.