Skip to content

Commit

Permalink
[clang] Limit scope of CLANG_VENDOR definition
Browse files Browse the repository at this point in the history
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.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D90516
  • Loading branch information
smeenai committed Nov 2, 2020
1 parent 7f32ddc commit 4e4ab8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 0 additions & 4 deletions clang/CMakeLists.txt
Expand Up @@ -332,10 +332,6 @@ set(CLANG_SYSTEMZ_DEFAULT_ARCH "z10" CACHE STRING "SystemZ Default Arch")
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.")

Expand Down
5 changes: 5 additions & 0 deletions clang/lib/Basic/CMakeLists.txt
Expand Up @@ -33,6 +33,11 @@ set_source_files_properties("${version_inc}"
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
Expand Down

0 comments on commit 4e4ab8e

Please sign in to comment.