From 33ec36a7d43b84eaa2377df441e926583371d2d5 Mon Sep 17 00:00:00 2001 From: Sergiu Deitsch Date: Thu, 8 Apr 2021 23:19:38 +0200 Subject: [PATCH] eliminated gflags related linker warnings (#569) --- CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c57b7afd2..10d08847e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -582,10 +582,12 @@ endif (HAVE_PTHREAD) if (gflags_FOUND) target_link_libraries (glog PUBLIC gflags) - if (NOT BUILD_SHARED_LIBS) - # Don't use __declspec(dllexport|dllimport) if this is a static build - targeT_compile_definitions (glog PUBLIC GFLAGS_DLL_DECLARE_FLAG= GFLAGS_DLL_DEFINE_FLAG=) - endif (NOT BUILD_SHARED_LIBS) + target_compile_definitions (glog + PRIVATE GFLAGS_DLL_DECLARE_FLAG=GOOGLE_GLOG_DLL_DECL + PRIVATE GFLAGS_DLL_DEFINE_FLAG=GOOGLE_GLOG_DLL_DECL + PUBLIC "$" + PUBLIC "$" + ) endif (gflags_FOUND) if (ANDROID)