[PATCH] D90516: [clang] Limit scope of CLANG_VENDOR definition

Shoaib Meenai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 30 17:47:11 PDT 2020


smeenai created this revision.
smeenai added reviewers: beanz, compnerd, phosek, tstellar.
Herald added subscribers: cfe-commits, dexonsmith, mgorny.
Herald added a project: clang.
smeenai requested review of this revision.

It's only used by Version.cpp, so limit the definition to just that one
file instead of making all of Clang recompile if you change CLANG_VENDOR.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90516

Files:
  clang/CMakeLists.txt
  clang/lib/Basic/CMakeLists.txt


Index: clang/lib/Basic/CMakeLists.txt
===================================================================
--- clang/lib/Basic/CMakeLists.txt
+++ clang/lib/Basic/CMakeLists.txt
@@ -33,6 +33,11 @@
   PROPERTIES GENERATED TRUE
              HEADER_FILE_ONLY TRUE)
 
+if(CLANG_VENDOR)
+  set_source_files_properties(Version.cpp
+    PROPERTIES COMPILE_DEFINITIONS "CLANG_VENDOR=\"${CLANG_VENDOR} \"")
+endif()
+
 add_clang_library(clangBasic
   Attributes.cpp
   Builtins.cpp
Index: clang/CMakeLists.txt
===================================================================
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -332,10 +332,6 @@
 set(CLANG_VENDOR ${PACKAGE_VENDOR} CACHE STRING
   "Vendor-specific text for showing with version information.")
 
-if( CLANG_VENDOR )
-  add_definitions( -DCLANG_VENDOR="${CLANG_VENDOR} " )
-endif()
-
 set(CLANG_REPOSITORY_STRING "" CACHE STRING
   "Vendor-specific text for showing the repository the source is taken from.")
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90516.302050.patch
Type: text/x-patch
Size: 969 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201031/ca7b1ec2/attachment.bin>


More information about the cfe-commits mailing list