From: Andrew Schwartzmeyer Date: Fri, 23 Jun 2017 19:39:49 +0000 (-0700) Subject: Link to DbgHelp using pre-processor directive X-Git-Tag: accepted/tizen/5.0/unified/20181102.024921~40^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=7f95ecfdc7023ebc8074ad9c71a9e0f095e1eefa;p=platform%2Fupstream%2Fglog.git Link to DbgHelp using pre-processor directive This method ensure that all users of glog get automatically linked to the DbgHelp library without needing to set compiler flags. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index b8f8bd8..af4680d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -458,7 +458,6 @@ endif (HAVE_EXECINFO_H) if (WIN32) set (HAVE_STACKTRACE 1) set (HAVE_SYMBOLIZE 1) - target_link_libraries (glog PUBLIC Dbghelp.lib) endif (WIN32) if (UNIX OR (APPLE AND HAVE_DLADDR)) diff --git a/src/demangle.cc b/src/demangle.cc index 7852043..4b33580 100644 --- a/src/demangle.cc +++ b/src/demangle.cc @@ -40,6 +40,7 @@ #if defined(OS_WINDOWS) #include +#pragma comment(lib, "DbgHelp") #endif _START_GOOGLE_NAMESPACE_ diff --git a/src/symbolize.cc b/src/symbolize.cc index 24dcddc..953f1db 100644 --- a/src/symbolize.cc +++ b/src/symbolize.cc @@ -840,6 +840,7 @@ _END_GOOGLE_NAMESPACE_ #elif defined(OS_WINDOWS) #include +#pragma comment(lib, "DbgHelp") _START_GOOGLE_NAMESPACE_