Replace the cmake generated export header

This commit is contained in:
Jeremy 2024-01-29 23:26:18 -06:00
parent b1ff59b59c
commit 5fde4081dc
No known key found for this signature in database
GPG Key ID: 19AA8270105E8EB4
2 changed files with 27 additions and 10 deletions

View File

@ -247,14 +247,6 @@ if(NOT CPPTRACE_BUILD_SHARED)
target_compile_definitions(${target_name} PUBLIC CPPTRACE_STATIC_DEFINE)
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 ----
# Hide all symbols by default

View File

@ -9,8 +9,33 @@
#include <type_traits>
#include <utility>
#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
#ifdef __has_include