Skip to content

Commit

Permalink
Link to DbgHelp using pre-processor directive
Browse files Browse the repository at this point in the history
This method ensure that all users of glog get automatically linked to
the DbgHelp library without needing to set compiler flags.
  • Loading branch information
andyleejordan committed Jun 27, 2017
1 parent e2caf98 commit 7f95ecf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions src/demangle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

#if defined(OS_WINDOWS)
#include <DbgHelp.h>
#pragma comment(lib, "DbgHelp")
#endif

_START_GOOGLE_NAMESPACE_
Expand Down
1 change: 1 addition & 0 deletions src/symbolize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@ _END_GOOGLE_NAMESPACE_
#elif defined(OS_WINDOWS)

#include <DbgHelp.h>
#pragma comment(lib, "DbgHelp")

_START_GOOGLE_NAMESPACE_

Expand Down

0 comments on commit 7f95ecf

Please sign in to comment.