Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -249,6 +249,10 @@ list(APPEND LIBCXXABI_LINK_FLAGS "-rtlib=compiler-rt") endif() +# Let the library headers know they are currently being used to build the +# library. +add_definitions(-D_LIBCXXABI_BUILDING_LIBRARY) + append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WERROR_FLAG -Werror=return-type) # Get warning flags @@ -333,7 +337,6 @@ add_definitions(-D_LIBCPP_HAS_THREAD_API_PTHREAD) endif() -# This is the _ONLY_ place where add_definitions is called. if (MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS) endif() Index: include/__cxxabi_config.h =================================================================== --- include/__cxxabi_config.h +++ include/__cxxabi_config.h @@ -21,8 +21,13 @@ #define __has_attribute(_attribute_) 0 #endif -#if defined(_LIBCXXABI_DLL) - #if defined(cxxabi_EXPORTS) +#if defined(_WIN32) + #if defined(_LIBCXXABI_DISABLE_DLL_IMPORT_EXPORT) + #define _LIBCXXABI_HIDDEN + #define _LIBCXXABI_DATA_VIS + #define _LIBCXXABI_FUNC_VIS + #define _LIBCXXABI_TYPE_VIS + #elif defined(_LIBCXXABI_BUILDING_LIBRARY) #define _LIBCXXABI_HIDDEN #define _LIBCXXABI_DATA_VIS __declspec(dllexport) #define _LIBCXXABI_FUNC_VIS __declspec(dllexport)