Skip to content

Commit 8d97f5e

Browse files
committed
fix: Resolved windows build issues.
1 parent f4131d3 commit 8d97f5e

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ option(
2222
OFF)
2323

2424
# Build static and dynamic lib written in Rust by invoking `cargo`.
25+
# Imports `questdb_client` target.
2526
add_subdirectory(corrosion)
2627
corrosion_import_crate(
2728
MANIFEST_PATH Cargo.toml
@@ -30,6 +31,15 @@ corrosion_import_crate(
3031
target_include_directories(
3132
questdb_client INTERFACE
3233
${CMAKE_CURRENT_SOURCE_DIR}/include)
34+
if(WIN32)
35+
set_target_properties(
36+
questdb_client-shared
37+
PROPERTIES
38+
DEFINE_SYMBOL "LINESENDER_DYN_LIB")
39+
target_link_libraries(
40+
questdb_client-shared
41+
INTERFACE wsock32 ws2_32)
42+
endif(WIN32)
3343

3444
function(set_compile_flags TARGET_NAME)
3545
if(MSVC)

include/questdb/ilp/line_sender.h

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,15 @@ extern "C" {
3232
#include <stddef.h>
3333
#include <stdbool.h>
3434

35-
#if defined(LINESENDER_DYN_LIB)
36-
# if defined(_MSC_VER)
37-
# if defined(LINESENDER_EXPORTS)
38-
# define LINESENDER_API __declspec(dllexport)
39-
# else
40-
# define LINESENDER_API __declspec(dllimport)
41-
# endif
42-
# elif (__GNUC__ >= 4)
43-
# define LINESENDER_API __attribute__ ((visibility("default")))
44-
# else
45-
# error "Compiler unsupported or badly detected."
46-
# endif
35+
#if defined(LINESENDER_DYN_LIB) && defined(_MSC_VER)
36+
# define LINESENDER_API __declspec(dllimport)
4737
#else
4838
# define LINESENDER_API
4939
#endif
5040

5141

5242
/////////// Error handling.
53-
/** An error that occured when using the line sender. */
43+
/** An error that occurred when using the line sender. */
5444
typedef struct line_sender_error line_sender_error;
5545

5646
/** Category of error. */

0 commit comments

Comments
 (0)