r333808 - [cmake] Use LLVM's check_linker_flag

Shoaib Meenai via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 1 17:49:55 PDT 2018


Author: smeenai
Date: Fri Jun  1 17:49:54 2018
New Revision: 333808

URL: http://llvm.org/viewvc/llvm-project?rev=333808&view=rev
Log:
[cmake] Use LLVM's check_linker_flag

LLVM already defines this function, so make use of it instead of rolling
our own.

Modified:
    cfe/trunk/tools/driver/CMakeLists.txt

Modified: cfe/trunk/tools/driver/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/CMakeLists.txt?rev=333808&r1=333807&r2=333808&view=diff
==============================================================================
--- cfe/trunk/tools/driver/CMakeLists.txt (original)
+++ cfe/trunk/tools/driver/CMakeLists.txt Fri Jun  1 17:49:54 2018
@@ -99,14 +99,7 @@ if (APPLE)
 endif()
 
 if(CLANG_ORDER_FILE AND (LD64_EXECUTABLE OR GOLD_EXECUTABLE))
-  include(CMakePushCheckState)
-
-  function(check_linker_flag flag out_var)
-    cmake_push_check_state()
-    set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${flag}")
-    check_cxx_compiler_flag("" ${out_var})
-    cmake_pop_check_state()
-  endfunction()
+  include(CheckLinkerFlag)
 
   if (LD64_EXECUTABLE)
     set(LINKER_ORDER_FILE_OPTION "-Wl,-order_file,${CLANG_ORDER_FILE}")




More information about the cfe-commits mailing list