File tree 10 files changed +29
-59
lines changed
10 files changed +29
-59
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ endif()
54
54
include (CMakeParseArguments)
55
55
include (BuildUtils)
56
56
include (ThirdpartyToolchain)
57
+ include (GenerateExportHeader)
57
58
58
59
add_subdirectory (src)
59
60
Original file line number Diff line number Diff line change @@ -211,6 +211,17 @@ function(add_iceberg_lib LIB_NAME)
211
211
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
212
212
endif ()
213
213
214
+ # generate export header file
215
+ string (TOUPPER ${LIB_NAME} LIB_NAME_UPPER)
216
+ if (BUILD_SHARED)
217
+ generate_export_header(${LIB_NAME} _shared BASE_NAME ${LIB_NAME_UPPER} )
218
+ if (BUILD_STATIC)
219
+ set_target_properties (${LIB_NAME} _static PROPERTIES COMPILE_FLAGS "-D${LIB_NAME_UPPER} _STATIC_DEFINE" )
220
+ endif ()
221
+ elseif (BUILD_STATIC)
222
+ generate_export_header(${LIB_NAME} _static BASE_NAME ${LIB_NAME_UPPER} )
223
+ endif ()
224
+
214
225
# Modify variable in calling scope
215
226
if (ARG_OUTPUTS)
216
227
set (${ARG_OUTPUTS}
@@ -243,13 +254,3 @@ function(iceberg_install_all_headers PATH)
243
254
endforeach ()
244
255
install (FILES ${PUBLIC_HEADERS} DESTINATION "${ICEBERG_INSTALL_INCLUDEDIR} /${PATH} " )
245
256
endfunction ()
246
-
247
- function (iceberg_set_export_definitions STATIC_TARGET LIB_TARGETS)
248
- if (ICEBERG_BUILD_STATIC AND WIN32 )
249
- target_compile_definitions (${STATIC_TARGET} PUBLIC ICEBERG_STATIC)
250
- endif ()
251
-
252
- foreach (LIB_TARGET ${LIB_TARGETS} )
253
- target_compile_definitions (${LIB_TARGET} PRIVATE ICEBERG_EXPORTING)
254
- endforeach ()
255
- endfunction ()
Original file line number Diff line number Diff line change 16
16
# under the License.
17
17
18
18
set (ICEBERG_SOURCES demo_table.cc)
19
- set (ICEBERG_INCLUDES "${CMAKE_SOURCE_DIR} /src" )
19
+ set (ICEBERG_INCLUDES "${CMAKE_SOURCE_DIR} /src" " ${CMAKE_BINARY_DIR} /src" )
20
20
21
21
add_iceberg_lib(iceberg
22
22
SOURCES
23
23
${ICEBERG_SOURCES}
24
- OUTPUTS
25
- ICEBERG_LIBRARIES
26
24
PRIVATE_INCLUDES
27
25
${ICEBERG_INCLUDES} )
28
26
29
- iceberg_set_export_definitions(iceberg_static "${ICEBERG_LIBRARIES} " )
30
27
iceberg_install_all_headers(iceberg)
31
28
29
+ install (FILES ${CMAKE_CURRENT_BINARY_DIR} /iceberg_export.h
30
+ DESTINATION ${ICEBERG_INSTALL_INCLUDEDIR} /iceberg)
31
+
32
32
add_subdirectory (arrow)
33
33
add_subdirectory (puffin)
34
34
Original file line number Diff line number Diff line change @@ -61,8 +61,6 @@ list(APPEND
61
61
add_iceberg_lib(iceberg_arrow
62
62
SOURCES
63
63
${ICEBERG_ARROW_SOURCES}
64
- OUTPUTS
65
- ICEBERG_ARROW_LIBRARIES
66
64
PRIVATE_INCLUDES
67
65
${ICEBERG_ARROW_INCLUDES}
68
66
SHARED_LINK_LIBS
@@ -74,5 +72,8 @@ add_iceberg_lib(iceberg_arrow
74
72
SHARED_INSTALL_INTERFACE_LIBS
75
73
${ICEBERG_ARROW_SHARED_INSTALL_INTERFACE_LIBS} )
76
74
77
- iceberg_set_export_definitions(iceberg_arrow_static " ${ICEBERG_ARROW_LIBRARIES} " )
75
+
78
76
iceberg_install_all_headers(iceberg/arrow)
77
+
78
+ install (FILES ${CMAKE_CURRENT_BINARY_DIR} /iceberg_arrow_export.h
79
+ DESTINATION ${ICEBERG_INSTALL_INCLUDEDIR} /iceberg/arrow)
Original file line number Diff line number Diff line change 21
21
22
22
#include < string>
23
23
24
+ #include " iceberg/arrow/iceberg_arrow_export.h"
24
25
#include " iceberg/table.h"
25
- #include " iceberg/visibility.h"
26
26
27
27
namespace iceberg ::arrow {
28
28
29
- class ICEBERG_EXPORT DemoArrow : public Table {
29
+ class ICEBERG_ARROW_EXPORT DemoArrow : public Table {
30
30
public:
31
31
DemoArrow () = default ;
32
32
~DemoArrow () override = default ;
Original file line number Diff line number Diff line change 21
21
22
22
#include < string>
23
23
24
- #include " iceberg/visibility .h"
24
+ #include " iceberg/iceberg_export .h"
25
25
26
26
namespace iceberg {
27
27
Original file line number Diff line number Diff line change @@ -39,8 +39,6 @@ list(APPEND
39
39
add_iceberg_lib(iceberg_puffin
40
40
SOURCES
41
41
${ICEBERG_PUFFIN_SOURCES}
42
- OUTPUTS
43
- ICEBERG_PUFFIN_LIBRARIES
44
42
PRIVATE_INCLUDES
45
43
${ICEBERG_PUFFIN_INCLUDES}
46
44
SHARED_LINK_LIBS
@@ -52,5 +50,7 @@ add_iceberg_lib(iceberg_puffin
52
50
SHARED_INSTALL_INTERFACE_LIBS
53
51
${ICEBERG_PUFFIN_SHARED_INSTALL_INTERFACE_LIBS} )
54
52
55
- iceberg_set_export_definitions(iceberg_puffin_static "${ICEBERG_PUFFIN_LIBRARIES} " )
56
53
iceberg_install_all_headers(iceberg/puffin)
54
+
55
+ install (FILES ${CMAKE_CURRENT_BINARY_DIR} /iceberg_puffin_export.h
56
+ DESTINATION ${ICEBERG_INSTALL_INCLUDEDIR} /iceberg/puffin)
Original file line number Diff line number Diff line change 20
20
#pragma once
21
21
22
22
#include " iceberg/puffin.h"
23
+ #include " iceberg/puffin/iceberg_puffin_export.h"
23
24
24
25
namespace iceberg ::puffin {
25
26
26
- class ICEBERG_EXPORT DemoPuffin : public Puffin {
27
+ class ICEBERG_PUFFIN_EXPORT DemoPuffin : public Puffin {
27
28
public:
28
29
DemoPuffin () = default ;
29
30
~DemoPuffin () override = default ;
Original file line number Diff line number Diff line change 21
21
22
22
#include < string>
23
23
24
- #include " iceberg/visibility .h"
24
+ #include " iceberg/iceberg_export .h"
25
25
26
26
namespace iceberg {
27
27
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments