diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake index 624a3c7..dfe0680 100644 --- a/CMake/AbseilHelpers.cmake +++ b/CMake/AbseilHelpers.cmake @@ -326,7 +326,12 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n") ) if (_build_type STREQUAL "dll") + if (${_in_dll}) set(ABSL_CC_LIB_DEPS abseil_dll) + endif() + if(${_in_test_dll}) + set(ABSL_CC_LIB_DEPS abseil_test_dll) + endif() endif() target_link_libraries(${_NAME} @@ -345,7 +350,7 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n") endif() endif() - if(ABSL_ENABLE_INSTALL) + if(ABSL_ENABLE_INSTALL AND NOT ABSL_CC_LIB_TESTONLY) install(TARGETS ${_NAME} EXPORT ${PROJECT_NAME}Targets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e7c856..a3c3dae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,7 +145,7 @@ if((BUILD_TESTING AND ABSL_BUILD_TESTING) OR ABSL_BUILD_TEST_HELPERS) add_library(GTest::gmock ALIAS gmock) add_library(GTest::gmock_main ALIAS gmock_main) else() - message(FATAL_ERROR "ABSL_USE_EXTERNAL_GOOGLETEST is ON and ABSL_FIND_GOOGLETEST is OFF, which means that the top-level project must build the Google Test project. However, the target gtest was not found.") + message(WARNING "ABSL_USE_EXTERNAL_GOOGLETEST is ON and ABSL_FIND_GOOGLETEST is OFF, which means that the top-level project must build the Google Test project. However, the target gtest was not found.") endif() endif() else() diff --git a/absl/flags/declare.h b/absl/flags/declare.h index 8d2a856..a154046 100644 --- a/absl/flags/declare.h +++ b/absl/flags/declare.h @@ -59,10 +59,15 @@ ABSL_NAMESPACE_END // Internal implementation of ABSL_DECLARE_FLAG to allow macro expansion of its // arguments. Clients must use ABSL_DECLARE_FLAG instead. +#if defined(_MSC_VER) +#define ABSL_DECLARE_FLAG_INTERNAL(type, name) \ + extern absl::Flag FLAGS_##name +#else #define ABSL_DECLARE_FLAG_INTERNAL(type, name) \ extern absl::Flag FLAGS_##name; \ namespace absl /* block flags in namespaces */ {} \ /* second redeclaration is to allow applying attributes */ \ extern absl::Flag FLAGS_##name +#endif // _MSC_VER #endif // ABSL_FLAGS_DECLARE_H_