Skip to content

Commit 0762134

Browse files
committed
add export
1 parent 5521235 commit 0762134

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

cmake_modules/IcebergBuildUtils.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ function(add_iceberg_lib LIB_NAME)
138138
target_include_directories(${LIB_NAME}_shared PRIVATE ${ARG_PRIVATE_INCLUDES})
139139
endif()
140140

141+
target_include_directories(${LIB_NAME}_shared
142+
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
143+
141144
set_target_properties(${LIB_NAME}_shared
142145
PROPERTIES LINK_FLAGS "${ARG_SHARED_LINK_FLAGS}" OUTPUT_NAME
143146
${LIB_NAME})
@@ -192,6 +195,9 @@ function(add_iceberg_lib LIB_NAME)
192195
set(LIB_NAME_STATIC ${LIB_NAME})
193196
endif()
194197

198+
target_include_directories(${LIB_NAME}_static
199+
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
200+
195201
set_target_properties(${LIB_NAME}_static PROPERTIES OUTPUT_NAME ${LIB_NAME_STATIC})
196202

197203
if(ARG_STATIC_INSTALL_INTERFACE_LIBS)

src/iceberg/catalog/rest/client.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#include <nlohmann/json.hpp>
2828

29-
#include "iceberg/iceberg_export.h"
29+
#include "iceberg/catalog/rest/iceberg_rest_catalog_export.h"
3030

3131
namespace iceberg::catalog::rest {
3232

@@ -35,7 +35,7 @@ using HttpHeaders = std::map<std::string, std::string>;
3535
/**
3636
* @brief Base exception for REST client errors.
3737
*/
38-
class ICEBERG_EXPORT RestException : public std::runtime_error {
38+
class ICEBERG_REST_CATALOG_EXPORT RestException : public std::runtime_error {
3939
public:
4040
explicit RestException(const std::string& message) : std::runtime_error(message) {}
4141
};
@@ -46,7 +46,7 @@ class ICEBERG_EXPORT RestException : public std::runtime_error {
4646
* This corresponds to the generic `E` type in the Rust implementation,
4747
* which is deserialized from the error response body.
4848
*/
49-
class ICEBERG_EXPORT ServerErrorException : public RestException {
49+
class ICEBERG_REST_CATALOG_EXPORT ServerErrorException : public RestException {
5050
public:
5151
ServerErrorException(int status_code, std::string response_body,
5252
nlohmann::json error_payload)
@@ -70,7 +70,7 @@ class ICEBERG_EXPORT ServerErrorException : public RestException {
7070
*
7171
* This corresponds to the `Error::new(ErrorKind::Unexpected, ...)` part in Rust.
7272
*/
73-
class ICEBERG_EXPORT ResponseParseException : public RestException {
73+
class ICEBERG_REST_CATALOG_EXPORT ResponseParseException : public RestException {
7474
public:
7575
ResponseParseException(std::string message, std::string response_body)
7676
: RestException(std::move(message)), response_body_(std::move(response_body)) {}
@@ -81,7 +81,7 @@ class ICEBERG_EXPORT ResponseParseException : public RestException {
8181
std::string response_body_;
8282
};
8383

84-
class ICEBERG_EXPORT HttpClient {
84+
class ICEBERG_REST_CATALOG_EXPORT HttpClient {
8585
public:
8686
HttpClient(const std::string& base_uri, const HttpHeaders& common_headers);
8787
~HttpClient();

src/iceberg/catalog/rest/rest_catalog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121

2222
#include <cpr/cpr.h>
2323

24-
#include "iceberg/iceberg_export.h"
24+
#include "iceberg/catalog/rest/iceberg_rest_catalog_export.h"
2525

2626
namespace iceberg::catalog::rest {
2727

28-
class ICEBERG_EXPORT RestCatalog {
28+
class ICEBERG_REST_CATALOG_EXPORT RestCatalog {
2929
public:
3030
explicit RestCatalog(const std::string& base_url);
3131
~RestCatalog() = default;

test/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,4 @@ if(ICEBERG_BUILD_REST_CATALOG)
146146
add_iceberg_test(rest_catalog_test SOURCES rest_catalog_test.cc)
147147
target_link_libraries(rest_catalog_test PRIVATE iceberg_rest_catalog_static)
148148
target_include_directories(rest_catalog_test PRIVATE ${cpp-httplib_SOURCE_DIR})
149-
150-
if(WIN32)
151-
target_link_libraries(rest_catalog_test PRIVATE ws2_32 crypt32)
152-
else()
153-
target_link_libraries(rest_catalog_test PRIVATE Threads::Threads)
154-
endif()
155-
156149
endif()

0 commit comments

Comments
 (0)