-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: preliminary find_package support
- Loading branch information
1 parent
18b9cfd
commit 6818481
Showing
24 changed files
with
277 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
include(declareProjectTest.cmake) | ||
add_subdirectory(test_find_package) | ||
add_subdirectory(test_add_subdirectory) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# This test assumes that the SDK has been installed at CMAKE_INSTALL_PREFIX. | ||
declare_find_package_test(test_find_package) | ||
add_build_step(test_find_package) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
cmake_minimum_required(VERSION 3.19) | ||
|
||
project(UseFindPackageTest) | ||
|
||
find_package(launchdarkly REQUIRED) | ||
|
||
add_executable(use_find_package_server main_server.cpp) | ||
target_link_libraries(use_find_package_server launchdarkly::launchdarkly-cpp-server) | ||
|
||
|
||
add_executable(use_find_package_client main_client.cpp) | ||
target_link_libraries(use_find_package_client launchdarkly::launchdarkly-cpp-client) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include <launchdarkly/client_side/client.hpp> | ||
#include <launchdarkly/context_builder.hpp> | ||
|
||
#include <cstring> | ||
#include <iostream> | ||
|
||
using namespace launchdarkly; | ||
using namespace launchdarkly::client_side; | ||
|
||
int main() { | ||
auto config = ConfigBuilder("sdk-key").Build(); | ||
if (!config) { | ||
std::cout << "error: config is invalid: " << config.error() << '\n'; | ||
return 1; | ||
} | ||
|
||
auto context = | ||
ContextBuilder().Kind("user", "example-user-key").Name("Sandy").Build(); | ||
|
||
auto client = Client(std::move(*config), std::move(context)); | ||
|
||
client.StartAsync(); | ||
|
||
std::cout << client.Initialized() << '\n'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <launchdarkly/server_side/client.hpp> | ||
#include <launchdarkly/server_side/config/config_builder.hpp> | ||
|
||
#include <cstring> | ||
#include <iostream> | ||
|
||
using namespace launchdarkly; | ||
using namespace launchdarkly::server_side; | ||
|
||
int main() { | ||
auto config = ConfigBuilder("sdk-key").Build(); | ||
if (!config) { | ||
std::cout << "error: config is invalid: " << config.error() << '\n'; | ||
return 1; | ||
} | ||
|
||
auto client = Client(std::move(*config)); | ||
|
||
client.StartAsync(); | ||
|
||
std::cout << client.Initialized() << '\n'; | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
include(CMakeFindDependencyMacro) | ||
|
||
if (NOT DEFINED Boost_USE_STATIC_LIBS) | ||
if (LD_DYNAMIC_LINK_BOOST) | ||
set(Boost_USE_STATIC_LIBS OFF) | ||
else () | ||
set(Boost_USE_STATIC_LIBS ON) | ||
endif () | ||
endif () | ||
|
||
find_dependency(Boost 1.81 COMPONENTS json url coroutine) | ||
find_dependency(OpenSSL) | ||
find_dependency(tl-expected) | ||
find_dependency(certify) | ||
|
||
include(${CMAKE_CURRENT_LIST_DIR}/launchdarklyTargets.cmake) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.