Skip to content

Commit 4214792

Browse files
committed
Separated Export.h from CMake
1 parent b0e44c7 commit 4214792

File tree

3 files changed

+47
-6
lines changed

3 files changed

+47
-6
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,3 @@ Saved
77
/compile_commands.json
88
compile_commands.json
99
Install
10-
11-
Include/Pipe/Export.h

CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ else()
5656
add_library(Pipe STATIC)
5757
endif()
5858

59-
generate_export_header(Pipe
60-
BASE_NAME PIPE
61-
EXPORT_MACRO_NAME PIPE_API
62-
EXPORT_FILE_NAME ${CMAKE_CURRENT_SOURCE_DIR}/Include/Pipe/Export.h)
6359
pipe_target_define_platform(Pipe)
6460

6561
target_include_directories(Pipe PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Include>)

Include/Pipe/Export.h

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
2+
#pragma once
3+
4+
#ifndef DLLEXPORT
5+
#define DLLEXPORT __declspec(dllexport)
6+
#endif
7+
#ifndef DLLIMPORT
8+
#define DLLIMPORT __declspec(dllimport)
9+
#endif
10+
11+
#ifndef PIPE_API
12+
#ifdef PIPE_STATIC_DEFINE
13+
#define PIPE_API
14+
#define PIPE_NO_EXPORT
15+
#else
16+
#ifdef PIPE_EXPORTS
17+
/* We are building this library */
18+
#define PIPE_API DLLEXPORT
19+
#else
20+
/* We are using this library */
21+
#define PIPE_API DLLIMPORT
22+
#endif
23+
#endif
24+
25+
#ifndef PIPE_NO_EXPORT
26+
#define PIPE_NO_EXPORT
27+
#endif
28+
#endif
29+
30+
#ifndef P_DEPRECATED
31+
#define P_DEPRECATED __declspec(deprecated)
32+
#endif
33+
34+
#ifndef P_DEPRECATED_EXPORT
35+
#define P_DEPRECATED_EXPORT PIPE_API P_DEPRECATED
36+
#endif
37+
38+
#ifndef P_DEPRECATED_NO_EXPORT
39+
#define P_DEPRECATED_NO_EXPORT PIPE_NO_EXPORT P_DEPRECATED
40+
#endif
41+
42+
/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */
43+
#if 0 /* DEFINE_NO_DEPRECATED */
44+
#ifndef P_NO_DEPRECATED
45+
#define P_NO_DEPRECATED
46+
#endif
47+
#endif

0 commit comments

Comments
 (0)