From 0027873af13e83a00df413edd9f6dbab7d7a4ae1 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Wed, 12 Jul 2017 21:37:02 +0000 Subject: [PATCH] Use --color-diagnostics instead of -color-diagnostics. Solaris ld interprets -color-diagnostics as a -c option, so it is better to use --color-diagnostics instead. lld accepts both. Differential Revision: https://reviews.llvm.org/D35327 llvm-svn: 307850 --- llvm/cmake/modules/HandleLLVMOptions.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake index 98f58d7b197d..0676317acc68 100644 --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -686,8 +686,8 @@ endif() # lld doesn't print colored diagnostics when invoked from Ninja if (UNIX AND CMAKE_GENERATOR STREQUAL "Ninja") include(CheckLinkerFlag) - check_linker_flag("-Wl,-color-diagnostics" LINKER_SUPPORTS_COLOR_DIAGNOSTICS) - append_if(LINKER_SUPPORTS_COLOR_DIAGNOSTICS "-Wl,-color-diagnostics" + check_linker_flag("-Wl,--color-diagnostics" LINKER_SUPPORTS_COLOR_DIAGNOSTICS) + append_if(LINKER_SUPPORTS_COLOR_DIAGNOSTICS "-Wl,--color-diagnostics" CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS) endif()