Replace the cmake generated export header
This commit is contained in:
parent
b1ff59b59c
commit
5fde4081dc
@ -247,14 +247,6 @@ if(NOT CPPTRACE_BUILD_SHARED)
|
|||||||
target_compile_definitions(${target_name} PUBLIC CPPTRACE_STATIC_DEFINE)
|
target_compile_definitions(${target_name} PUBLIC CPPTRACE_STATIC_DEFINE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# generate header file with export macros prefixed with BASE_NAME
|
|
||||||
include(GenerateExportHeader)
|
|
||||||
generate_export_header(
|
|
||||||
${target_name}
|
|
||||||
BASE_NAME cpptrace
|
|
||||||
EXPORT_FILE_NAME include/cpptrace/cpptrace_export.hpp
|
|
||||||
)
|
|
||||||
|
|
||||||
# ---- Library Properties ----
|
# ---- Library Properties ----
|
||||||
|
|
||||||
# Hide all symbols by default
|
# Hide all symbols by default
|
||||||
|
|||||||
@ -9,8 +9,33 @@
|
|||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
// Generated by the build system.
|
|
||||||
#include <cpptrace/cpptrace_export.hpp>
|
#ifdef _WIN32
|
||||||
|
#define CPPTRACE_EXPORT_ATTR __declspec(dllexport)
|
||||||
|
#define CPPTRACE_IMPORT_ATTR __declspec(dllimport)
|
||||||
|
#define CPPTRACE_NO_EXPORT_ATTR
|
||||||
|
#define CPPTRACE_DEPRECATED_ATTR __declspec(deprecated)
|
||||||
|
#else
|
||||||
|
#define CPPTRACE_EXPORT_ATTR __attribute__((visibility("default")))
|
||||||
|
#define CPPTRACE_IMPORT_ATTR __attribute__((visibility("default")))
|
||||||
|
#define CPPTRACE_NO_EXPORT_ATTR __attribute__((visibility("hidden")))
|
||||||
|
#define CPPTRACE_DEPRECATE_ATTR __attribute__((__deprecated__))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CPPTRACE_STATIC_DEFINE
|
||||||
|
# define CPPTRACE_EXPORT
|
||||||
|
# define CPPTRACE_NO_EXPORT
|
||||||
|
#else
|
||||||
|
# ifndef CPPTRACE_EXPORT
|
||||||
|
# ifdef cpptrace_lib_EXPORTS
|
||||||
|
/* We are building this library */
|
||||||
|
# define CPPTRACE_EXPORT CPPTRACE_EXPORT_ATTR
|
||||||
|
# else
|
||||||
|
/* We are using this library */
|
||||||
|
# define CPPTRACE_EXPORT CPPTRACE_IMPORT_ATTR
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if __cplusplus >= 202002L
|
#if __cplusplus >= 202002L
|
||||||
#ifdef __has_include
|
#ifdef __has_include
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user