kou commented on code in PR #6:
URL: https://github.com/apache/iceberg-cpp/pull/6#discussion_r1900344597
##########
cmake_modules/BuildUtils.cmake:
##########
@@ -182,13 +183,7 @@ function(ADD_ICEBERG_LIB LIB_NAME)
target_include_directories(${LIB_NAME}_static PRIVATE
${ARG_PRIVATE_INCLUDES})
endif()
- if(MSVC_TOOLCHAIN)
- set(LIB_NAME_STATIC ${LIB_NAME}_static)
- else()
- set(LIB_NAME_STATIC ${LIB_NAME})
- endif()
-
- set_target_properties(${LIB_NAME}_static PROPERTIES OUTPUT_NAME
${LIB_NAME_STATIC})
+ set_target_properties(${LIB_NAME}_static PROPERTIES OUTPUT_NAME
${LIB_NAME})
Review Comment:
I got it. This happens because `libiceberg_arrow.dll` doesn't export any
symbols.
Could you try this?
```diff
diff --git a/src/arrow/CMakeLists.txt b/src/arrow/CMakeLists.txt
index 87bc0ff..7c640fb 100644
--- a/src/arrow/CMakeLists.txt
+++ b/src/arrow/CMakeLists.txt
@@ -59,6 +59,8 @@ list(APPEND
add_iceberg_lib(iceberg_arrow
SOURCES
${ICEBERG_ARROW_SOURCES}
+ OUTPUTS
+ ICEBERG_ARROW_LIBRARIES
PRIVATE_INCLUDES
${ICEBERG_ARROW_INCLUDES}
SHARED_LINK_LIBS
@@ -69,6 +71,12 @@ add_iceberg_lib(iceberg_arrow
${ICEBERG_ARROW_STATIC_INSTALL_INTERFACE_LIBS}
SHARED_INSTALL_INTERFACE_LIBS
${ICEBERG_ARROW_SHARED_INSTALL_INTERFACE_LIBS})
+if(ICEBERG_BUILD_STATIC AND WIN32)
+ target_compile_definitions(iceberg_arrow_static PUBLIC
ICEBERG_ARROW_STATIC)
+endif()
+foreach(LIB_TARGET ${ICEBERG_ARROW_LIBRARIES})
+ target_compile_definitions(${LIB_TARGET} PRIVATE ICEBERG_ARROW_EXPORTING)
+endforeach()
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/demo_arrow.h"
DESTINATION "${ICEBERG_INSTALL_INCLUDEDIR}/iceberg/arrow")
diff --git a/src/arrow/demo_arrow.h b/src/arrow/demo_arrow.h
index 69517f6..8fe014a 100644
--- a/src/arrow/demo_arrow.h
+++ b/src/arrow/demo_arrow.h
@@ -21,9 +21,23 @@
#include <string>
+#ifdef _WIN32
+# ifdef ICEBERG_ARROW_STATIC
+# define ICEBERG_ARROW_EXPORT
+# else
+# ifdef ICEBERG_ARROW_EXPORTING
+# define ICEBERG_ARROW_EXPORT __declspec(dllexport)
+# else
+# define ICEBERG_ARROW_EXPORT __declspec(dllimport)
+# endif
+# endif
+#else
+# define ICEBERG_ARROW_EXPORT
+#endif
+
namespace iceberg::arrow {
-class DemoArrow {
+class ICEBERG_ARROW_EXPORT DemoArrow {
public:
std::string print() const;
};
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]