Skip to content
Merged
2 changes: 1 addition & 1 deletion apps/hello-cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

add_executable(hello-cpp main.cpp)
target_link_libraries(hello-cpp PRIVATE launchdarkly::client launchdarkly::sse launchdarkly::common Threads::Threads)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Common being included was causing all kinds of missing symbols, when all those are already in client.

target_link_libraries(hello-cpp PRIVATE launchdarkly::client Threads::Threads)
21 changes: 0 additions & 21 deletions apps/hello-cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,27 +126,6 @@ int main() {
std::cout << "Reason was: " << *reason << std::endl;
}

// Identify a series of contexts.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this, because sleep isn't just included in windows.

for (auto context_index = 0; context_index < 4; context_index++) {
std::cout << "Identifying user: "
<< "ryan" << context_index << std::endl;
auto future = client.IdentifyAsync(
ContextBuilder()
.kind("user", "ryan" + std::to_string(context_index))
.build());
auto before_ident =
client.BoolVariationDetail("my-boolean-flag", false);
future.get();
auto after_ident = client.BoolVariationDetail("my-boolean-flag", false);

std::cout << "For: "
<< "ryan" << context_index << ": "
<< "Before ident complete: " << *before_init
<< " After: " << *after_ident << std::endl;

sleep(1);
}

// Sit around.
std::cout << "Press enter to exit" << std::endl << std::endl;
std::cin.get();
Expand Down
4 changes: 4 additions & 0 deletions libs/client-sdk/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ target_link_libraries(${LIBNAME}

add_library(launchdarkly::client ALIAS ${LIBNAME})


set_property(TARGET ${LIBNAME} PROPERTY
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may need to have a more complex version of this eventually. But as is we always dynamically link against the windows runtime. Either the debug or release version.

MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")

install(TARGETS ${LIBNAME})
# Using PUBLIC_HEADERS would flatten the include.
# This will preserve it, but dependencies must do the same.
Expand Down
3 changes: 3 additions & 0 deletions libs/common/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ add_library(${LIBNAME} OBJECT

add_library(launchdarkly::common ALIAS ${LIBNAME})

set_property(TARGET ${LIBNAME} PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")

install(TARGETS ${LIBNAME})

# Using PUBLIC_HEADERS would flatten the include.
Expand Down
4 changes: 4 additions & 0 deletions libs/internal/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ add_library(${LIBNAME} OBJECT

add_library(launchdarkly::internal ALIAS ${LIBNAME})


set_property(TARGET ${LIBNAME} PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")

install(TARGETS ${LIBNAME})

message(STATUS "LaunchDarklyInternalSdk_SOURCE_DIR=${LaunchDarklyInternalSdk_SOURCE_DIR}")
Expand Down
4 changes: 4 additions & 0 deletions libs/server-sent-events/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ target_link_libraries(${LIBNAME}

add_library(launchdarkly::sse ALIAS ${LIBNAME})


set_property(TARGET ${LIBNAME} PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")

install(TARGETS ${LIBNAME})

# Need the public headers to build.
Expand Down