[PATCH] D13216: [CMake] Move the setting of LLVM_COMPILER_IS_GCC_COMPATIBLE to a separate file
John Brawn via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 29 07:35:36 PDT 2015
This revision was automatically updated to reflect the committed changes.
Closed by commit rL248798: [CMake] Move the setting of LLVM_COMPILER_IS_GCC_COMPATIBLE to a separate file (authored by john.brawn).
Changed prior to commit:
http://reviews.llvm.org/D13216?vs=35878&id=35976#toc
Repository:
rL LLVM
http://reviews.llvm.org/D13216
Files:
llvm/trunk/cmake/modules/AddLLVM.cmake
llvm/trunk/cmake/modules/DetermineGCCCompatible.cmake
llvm/trunk/cmake/modules/HandleLLVMStdlib.cmake
Index: llvm/trunk/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake
+++ llvm/trunk/cmake/modules/AddLLVM.cmake
@@ -1,5 +1,6 @@
include(LLVMProcessSources)
include(LLVM-Config)
+include(DetermineGCCCompatible)
function(llvm_update_compile_flags name)
get_property(sources TARGET ${name} PROPERTY SOURCES)
Index: llvm/trunk/cmake/modules/DetermineGCCCompatible.cmake
===================================================================
--- llvm/trunk/cmake/modules/DetermineGCCCompatible.cmake
+++ llvm/trunk/cmake/modules/DetermineGCCCompatible.cmake
@@ -0,0 +1,11 @@
+# Determine if the compiler has GCC-compatible command-line syntax.
+
+if(NOT DEFINED LLVM_COMPILER_IS_GCC_COMPATIBLE)
+ if(CMAKE_COMPILER_IS_GNUCXX)
+ set(LLVM_COMPILER_IS_GCC_COMPATIBLE ON)
+ elseif( MSVC )
+ set(LLVM_COMPILER_IS_GCC_COMPATIBLE OFF)
+ elseif( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+ set(LLVM_COMPILER_IS_GCC_COMPATIBLE ON)
+ endif()
+endif()
Index: llvm/trunk/cmake/modules/HandleLLVMStdlib.cmake
===================================================================
--- llvm/trunk/cmake/modules/HandleLLVMStdlib.cmake
+++ llvm/trunk/cmake/modules/HandleLLVMStdlib.cmake
@@ -1,17 +1,11 @@
# This CMake module is responsible for setting the standard library to libc++
# if the user has requested it.
+include(DetermineGCCCompatible)
+
if(NOT DEFINED LLVM_STDLIB_HANDLED)
set(LLVM_STDLIB_HANDLED ON)
- if(CMAKE_COMPILER_IS_GNUCXX)
- set(LLVM_COMPILER_IS_GCC_COMPATIBLE ON)
- elseif( MSVC )
- set(LLVM_COMPILER_IS_GCC_COMPATIBLE OFF)
- elseif( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
- set(LLVM_COMPILER_IS_GCC_COMPATIBLE ON)
- endif()
-
function(append value)
foreach(variable ${ARGN})
set(${variable} "${${variable}} ${value}" PARENT_SCOPE)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13216.35976.patch
Type: text/x-patch
Size: 1884 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150929/9d877e1c/attachment.bin>
More information about the llvm-commits
mailing list