[PATCH] D28046: Add -Wl, -color-diagnostics if a linker supports the option.
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 3 16:49:10 PST 2017
ruiu added inline comments.
================
Comment at: llvm/cmake/modules/HandleLLVMOptions.cmake:592
+if (UNIX AND CMAKE_GENERATOR STREQUAL "Ninja")
+ set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Wl,-color-diagnostics")
----------------
inglorion wrote:
> Why not check_cxx_compiler_flag("-Wl,-color-diagnostics" LINKER_SUPPORTS_COLOR_DIAGNOSTICS), analogous with check_c_compiler_flag below for -fno-function-sections? Would that allow us to avoid the dance with saving CMAKE_REQUIRED_FLAGS and restoring it to its old value?
check_c_compiler_flags doesn't seem to link the result. It just compiles. So it cannot be used for testing -Wl,-something flags.
https://reviews.llvm.org/D28046
More information about the llvm-commits
mailing list