[PATCH] D13432: cmake: Avoid leading space in LLVM_DEFINITIONS.

Paweł Bylica via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 5 04:33:26 PDT 2015


chfast created this revision.
chfast added a subscriber: llvm-commits.

Unnecessary space at the beginning of LLVM_DEFINITIONS in cmake shared files can break projects that use the variable.

http://reviews.llvm.org/D13432

Files:
  cmake/modules/AddLLVMDefinitions.cmake

Index: cmake/modules/AddLLVMDefinitions.cmake
===================================================================
--- cmake/modules/AddLLVMDefinitions.cmake
+++ cmake/modules/AddLLVMDefinitions.cmake
@@ -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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13432.36502.patch
Type: text/x-patch
Size: 614 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151005/608463ad/attachment.bin>


More information about the llvm-commits mailing list