cmake: Avoid leading space in LLVM_DEFINITIONS.
authorPawel Bylica <chfast@gmail.com>
Mon, 12 Oct 2015 10:42:03 +0000 (10:42 +0000)
committerPawel Bylica <chfast@gmail.com>
Mon, 12 Oct 2015 10:42:03 +0000 (10:42 +0000)
Summary: Unnecessary space at the beginning of LLVM_DEFINITIONS in cmake shared files can break projects that use the variable.

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D13432

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250025 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/AddLLVMDefinitions.cmake

index 33ac973..dab1623 100644 (file)
@@ -7,7 +7,11 @@
 macro(add_llvm_definitions)
   # We don't want no semicolons on LLVM_DEFINITIONS:
   foreach(arg ${ARGN})
-    set(LLVM_DEFINITIONS "${LLVM_DEFINITIONS} ${arg}")
+    if(DEFINED LLVM_DEFINITIONS)
+      set(LLVM_DEFINITIONS "${LLVM_DEFINITIONS} ${arg}")
+    else()
+      set(LLVM_DEFINITIONS ${arg})
+    endif()
   endforeach(arg)
   add_definitions( ${ARGN} )
 endmacro(add_llvm_definitions)