Skip to content

Commit

Permalink
QUILL_EXPORT fix for windows shared library
Browse files Browse the repository at this point in the history
  • Loading branch information
odygrd committed Jun 2, 2023
1 parent 5320c25 commit 15e2111
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions examples/example_logging_to_file.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// #define QUILL_BUILD_SHARED // if linking against quill.dll
#include "quill/Quill.h"

static char const* filename = "example_filehandler.log";
Expand Down
1 change: 1 addition & 0 deletions quill/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ add_library(${TARGET_NAME}::${TARGET_NAME} ALIAS ${TARGET_NAME})

if (BUILD_SHARED_LIBS)
target_compile_definitions(${TARGET_NAME} PRIVATE -DQUILL_DLL_EXPORT)
target_compile_definitions(${TARGET_NAME} PRIVATE -DQUILL_BUILD_SHARED)
set_property(TARGET ${TARGET_NAME} PROPERTY CXX_VISIBILITY_PRESET default)
set_property(TARGET ${TARGET_NAME} PROPERTY VISIBILITY_INLINES_HIDDEN OFF)
endif ()
Expand Down
4 changes: 2 additions & 2 deletions quill/include/quill/detail/misc/Attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@

// visibility
#if defined(_WIN32)
#if defined(QUILL_DLL_EXPORT)
#if defined(QUILL_DLL_EXPORT) && defined(QUILL_BUILD_SHARED)
#define QUILL_EXPORT __declspec(dllexport)
#else
#elif defined(QUILL_BUILD_SHARED)
#define QUILL_EXPORT __declspec(dllimport)
#endif
#elif defined(__GNUC__) || defined(__clang__)
Expand Down

0 comments on commit 15e2111

Please sign in to comment.