Skip to content

Commit 3f6df87

Browse files
committed
move iceberg_core location
1 parent fdc0294 commit 3f6df87

File tree

5 files changed

+27
-52
lines changed

5 files changed

+27
-52
lines changed

cmake_modules/BuildUtils.cmake

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function(iceberg_install_cmake_package PACKAGE_NAME EXPORT_NAME)
3939
FILE "${TARGETS_CMAKE}")
4040
endfunction()
4141

42-
function(ADD_ICEBERG_LIB LIB_NAME)
42+
function(add_iceberg_lib LIB_NAME)
4343
set(options)
4444
set(one_value_args
4545
BUILD_SHARED
@@ -218,3 +218,13 @@ function(ADD_ICEBERG_LIB LIB_NAME)
218218
PARENT_SCOPE)
219219
endif()
220220
endfunction()
221+
222+
function(iceberg_set_export_definitions STATIC_TARGET LIB_TARGETS)
223+
if(ICEBERG_BUILD_STATIC AND WIN32)
224+
target_compile_definitions(${STATIC_TARGET} PUBLIC ICEBERG_STATIC)
225+
endif()
226+
227+
foreach(LIB_TARGET ${LIB_TARGETS})
228+
target_compile_definitions(${LIB_TARGET} PRIVATE ICEBERG_EXPORTING)
229+
endforeach()
230+
endfunction()

src/CMakeLists.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,20 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
add_subdirectory(core)
19-
add_subdirectory(puffin)
18+
set(ICEBERG_CORE_SOURCES core/demo_table.cc)
19+
set(ICEBERG_CORE_INCLUDES "${ICEBERG_API_DIR}")
20+
21+
add_iceberg_lib(iceberg_core
22+
SOURCES
23+
${ICEBERG_CORE_SOURCES}
24+
OUTPUTS
25+
ICEBERG_CORE_LIBRARIES
26+
PRIVATE_INCLUDES
27+
${ICEBERG_CORE_INCLUDES})
28+
29+
iceberg_set_export_definitions(iceberg_core_static "${ICEBERG_CORE_LIBRARIES}")
30+
2031
add_subdirectory(arrow)
32+
add_subdirectory(puffin)
2133

2234
iceberg_install_cmake_package(Iceberg iceberg_targets)

src/arrow/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,7 @@ add_iceberg_lib(iceberg_arrow
7272
SHARED_INSTALL_INTERFACE_LIBS
7373
${ICEBERG_ARROW_SHARED_INSTALL_INTERFACE_LIBS})
7474

75-
if(ICEBERG_BUILD_STATIC AND WIN32)
76-
target_compile_definitions(iceberg_arrow_static PUBLIC ICEBERG_STATIC)
77-
endif()
78-
79-
foreach(LIB_TARGET ${ICEBERG_ARROW_LIBRARIES})
80-
target_compile_definitions(${LIB_TARGET} PRIVATE ICEBERG_EXPORTING)
81-
endforeach()
75+
iceberg_set_export_definitions(iceberg_arrow_static "${ICEBERG_ARROW_LIBRARIES}")
8276

8377
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/demo_arrow.h"
8478
DESTINATION "${ICEBERG_INSTALL_INCLUDEDIR}/iceberg/arrow")

src/core/CMakeLists.txt

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/puffin/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,4 @@ add_iceberg_lib(iceberg_puffin
2626
PRIVATE_INCLUDES
2727
${ICEBERG_PUFFIN_INCLUDES})
2828

29-
if(ICEBERG_BUILD_STATIC AND WIN32)
30-
target_compile_definitions(iceberg_puffin_static PUBLIC ICEBERG_STATIC)
31-
endif()
32-
33-
foreach(LIB_TARGET ${ICEBERG_PUFFIN_LIBRARIES})
34-
target_compile_definitions(${LIB_TARGET} PRIVATE ICEBERG_EXPORTING)
35-
endforeach()
29+
iceberg_set_export_definitions(iceberg_puffin_static "${ICEBERG_PUFFIN_LIBRARIES}")

0 commit comments

Comments
 (0)