diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake index 091aec98e93ca3..3eb018c9acf31d 100644 --- a/clang/cmake/modules/AddClang.cmake +++ b/clang/cmake/modules/AddClang.cmake @@ -47,7 +47,7 @@ endmacro() macro(add_clang_library name) cmake_parse_arguments(ARG - "SHARED;STATIC;INSTALL_WITH_TOOLCHAIN" + "SHARED;STATIC;OBJECT;INSTALL_WITH_TOOLCHAIN;CLANG_EXPORT" "" "ADDITIONAL_HEADERS" ${ARGN}) @@ -114,7 +114,7 @@ macro(add_clang_library name) if(TARGET "obj.${name}") target_compile_definitions("obj.${name}" PUBLIC CLANG_BUILD_STATIC) endif() - elseif(NOT ARG_SHARED AND NOT ARG_STATIC) + elseif(ARG_CLANG_EXPORT OR NOT (ARG_SHARED OR ARG_STATIC OR ARG_OBJECT)) # Clang component libraries linked in to clang-cpp are declared without SHARED or STATIC target_compile_definitions("obj.${name}" PUBLIC CLANG_EXPORTS) endif()