Skip to content

Commit 93c4228

Browse files
committed
try to fix windows build
1 parent 5a064c9 commit 93c4228

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/arrow/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ list(APPEND
5959
add_iceberg_lib(iceberg_arrow
6060
SOURCES
6161
${ICEBERG_ARROW_SOURCES}
62+
OUTPUTS
63+
ICEBERG_ARROW_LIBRARIES
6264
PRIVATE_INCLUDES
6365
${ICEBERG_ARROW_INCLUDES}
6466
SHARED_LINK_LIBS
@@ -70,5 +72,13 @@ add_iceberg_lib(iceberg_arrow
7072
SHARED_INSTALL_INTERFACE_LIBS
7173
${ICEBERG_ARROW_SHARED_INSTALL_INTERFACE_LIBS})
7274

75+
if(ICEBERG_BUILD_STATIC AND WIN32)
76+
target_compile_definitions(iceberg_arrow_static PUBLIC ICEBERG_ARROW_STATIC)
77+
endif()
78+
79+
foreach(LIB_TARGET ${ICEBERG_ARROW_LIBRARIES})
80+
target_compile_definitions(${LIB_TARGET} PRIVATE ICEBERG_ARROW_EXPORTING)
81+
endforeach()
82+
7383
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/demo_arrow.h"
7484
DESTINATION "${ICEBERG_INSTALL_INCLUDEDIR}/iceberg/arrow")

src/arrow/demo_arrow.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,23 @@
2121

2222
#include <string>
2323

24+
#ifdef _WIN32
25+
# ifdef ICEBERG_ARROW_STATIC
26+
# define ICEBERG_ARROW_EXPORT
27+
# else
28+
# ifdef ICEBERG_ARROW_EXPORTING
29+
# define ICEBERG_ARROW_EXPORT __declspec(dllexport)
30+
# else
31+
# define ICEBERG_ARROW_EXPORT __declspec(dllimport)
32+
# endif
33+
# endif
34+
#else
35+
# define ICEBERG_ARROW_EXPORT
36+
#endif
37+
2438
namespace iceberg::arrow {
2539

26-
class DemoArrow {
40+
class ICEBERG_ARROW_EXPORT DemoArrow {
2741
public:
2842
std::string print() const;
2943
};

0 commit comments

Comments
 (0)