wgtmac commented on code in PR #231:
URL: https://github.com/apache/iceberg-cpp/pull/231#discussion_r2354290141
##########
src/iceberg/CMakeLists.txt:
##########
@@ -61,23 +61,27 @@ set(ICEBERG_SHARED_INSTALL_INTERFACE_LIBS)
list(APPEND
ICEBERG_STATIC_BUILD_INTERFACE_LIBS
nanoarrow::nanoarrow_static
+ roaring::roaring
nlohmann_json::nlohmann_json
spdlog::spdlog
ZLIB::ZLIB)
list(APPEND
ICEBERG_SHARED_BUILD_INTERFACE_LIBS
nanoarrow::nanoarrow_shared
+ roaring::roaring
nlohmann_json::nlohmann_json
spdlog::spdlog
ZLIB::ZLIB)
list(APPEND
ICEBERG_STATIC_INSTALL_INTERFACE_LIBS
"$<IF:$<BOOL:${NANOARROW_VENDORED}>,Iceberg::nanoarrow_static,$<IF:$<TARGET_EXISTS:nanoarrow::nanoarrow_static>,nanoarrow::nanoarrow_static,nanoarrow::nanoarrow_shared>>"
+
"$<IF:$<BOOL:${CROARING_VENDORED}>,Iceberg::roaring,$<IF:$<TARGET_EXISTS:roaring::roaring>,roaring::roaring,roaring::roaring>>"
Review Comment:
```suggestion
"$<IF:$<BOOL:${CROARING_VENDORED}>,Iceberg::roaring,roaring::roaring>"
```
##########
test/roaring_test.cc:
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#include "roaring/roaring.hh"
+
+#include <gtest/gtest.h>
+
+#include "roaring/roaring64map.hh"
Review Comment:
```suggestion
#include <gtest/gtest.h>
#include <roaring/roaring.hh>
#include <roaring/roaring64map.hh>
```
##########
src/iceberg/CMakeLists.txt:
##########
@@ -61,23 +61,27 @@ set(ICEBERG_SHARED_INSTALL_INTERFACE_LIBS)
list(APPEND
ICEBERG_STATIC_BUILD_INTERFACE_LIBS
nanoarrow::nanoarrow_static
+ roaring::roaring
nlohmann_json::nlohmann_json
spdlog::spdlog
ZLIB::ZLIB)
list(APPEND
ICEBERG_SHARED_BUILD_INTERFACE_LIBS
nanoarrow::nanoarrow_shared
+ roaring::roaring
nlohmann_json::nlohmann_json
spdlog::spdlog
ZLIB::ZLIB)
list(APPEND
ICEBERG_STATIC_INSTALL_INTERFACE_LIBS
"$<IF:$<BOOL:${NANOARROW_VENDORED}>,Iceberg::nanoarrow_static,$<IF:$<TARGET_EXISTS:nanoarrow::nanoarrow_static>,nanoarrow::nanoarrow_static,nanoarrow::nanoarrow_shared>>"
+
"$<IF:$<BOOL:${CROARING_VENDORED}>,Iceberg::roaring,$<IF:$<TARGET_EXISTS:roaring::roaring>,roaring::roaring,roaring::roaring>>"
"$<IF:$<BOOL:${NLOHMANN_JSON_VENDORED}>,Iceberg::nlohmann_json,$<IF:$<TARGET_EXISTS:nlohmann_json::nlohmann_json>,nlohmann_json::nlohmann_json,nlohmann_json::nlohmann_json>>"
"$<IF:$<BOOL:${SPDLOG_VENDORED}>,Iceberg::spdlog,spdlog::spdlog>")
list(APPEND
ICEBERG_SHARED_INSTALL_INTERFACE_LIBS
"$<IF:$<BOOL:${NANOARROW_VENDORED}>,Iceberg::nanoarrow_shared,$<IF:$<TARGET_EXISTS:nanoarrow::nanoarrow_shared>,nanoarrow::nanoarrow_shared,nanoarrow::nanoarrow_static>>"
+
"$<IF:$<BOOL:${CROARING_VENDORED}>,Iceberg::roaring,$<IF:$<TARGET_EXISTS:roaring::roaring>,roaring::roaring,roaring::roaring>>"
Review Comment:
ditto
##########
src/iceberg/CMakeLists.txt:
##########
@@ -61,23 +61,27 @@ set(ICEBERG_SHARED_INSTALL_INTERFACE_LIBS)
list(APPEND
ICEBERG_STATIC_BUILD_INTERFACE_LIBS
nanoarrow::nanoarrow_static
+ roaring::roaring
nlohmann_json::nlohmann_json
spdlog::spdlog
ZLIB::ZLIB)
list(APPEND
ICEBERG_SHARED_BUILD_INTERFACE_LIBS
nanoarrow::nanoarrow_shared
+ roaring::roaring
nlohmann_json::nlohmann_json
spdlog::spdlog
ZLIB::ZLIB)
list(APPEND
ICEBERG_STATIC_INSTALL_INTERFACE_LIBS
"$<IF:$<BOOL:${NANOARROW_VENDORED}>,Iceberg::nanoarrow_static,$<IF:$<TARGET_EXISTS:nanoarrow::nanoarrow_static>,nanoarrow::nanoarrow_static,nanoarrow::nanoarrow_shared>>"
+
"$<IF:$<BOOL:${CROARING_VENDORED}>,Iceberg::roaring,$<IF:$<TARGET_EXISTS:roaring::roaring>,roaring::roaring,roaring::roaring>>"
Review Comment:
`If` and `else` are the same so we can combine them.
##########
src/iceberg/IcebergConfig.cmake.in:
##########
@@ -70,6 +70,15 @@ endmacro()
# Find system dependencies
iceberg_find_dependencies("${ICEBERG_SYSTEM_DEPENDENCIES}")
+# Create missing CRoaring targets if they don't exist
+if(NOT TARGET roaring::roaring-headers)
+ add_library(roaring::roaring-headers INTERFACE IMPORTED)
+endif()
+
+if(NOT TARGET roaring::roaring-headers-cpp)
+ add_library(roaring::roaring-headers-cpp INTERFACE IMPORTED)
+endif()
+
include("${CMAKE_CURRENT_LIST_DIR}/IcebergTargets.cmake")
Review Comment:
```suggestion
include("${CMAKE_CURRENT_LIST_DIR}/IcebergTargets.cmake")
# Create missing CRoaring targets if they don't exist
if(NOT TARGET roaring::roaring-headers)
add_library(roaring::roaring-headers INTERFACE IMPORTED)
endif()
if(NOT TARGET roaring::roaring-headers-cpp)
add_library(roaring::roaring-headers-cpp INTERFACE IMPORTED)
endif()
```
##########
src/iceberg/CMakeLists.txt:
##########
@@ -61,23 +61,27 @@ set(ICEBERG_SHARED_INSTALL_INTERFACE_LIBS)
list(APPEND
ICEBERG_STATIC_BUILD_INTERFACE_LIBS
nanoarrow::nanoarrow_static
+ roaring::roaring
Review Comment:
Please sort alphabetically. Same for below
##########
src/iceberg/IcebergConfig.cmake.in:
##########
@@ -70,6 +70,15 @@ endmacro()
# Find system dependencies
iceberg_find_dependencies("${ICEBERG_SYSTEM_DEPENDENCIES}")
+# Create missing CRoaring targets if they don't exist
+if(NOT TARGET roaring::roaring-headers)
+ add_library(roaring::roaring-headers INTERFACE IMPORTED)
+endif()
+
+if(NOT TARGET roaring::roaring-headers-cpp)
+ add_library(roaring::roaring-headers-cpp INTERFACE IMPORTED)
+endif()
+
include("${CMAKE_CURRENT_LIST_DIR}/IcebergTargets.cmake")
Review Comment:
We need to switch the order just in case `IcebergTargets.cmake` includes
these targets. Overall, this is a nice fix!
--
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]