Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RCPP-41 Add Conan support #174

Merged
merged 18 commits into from
Mar 22, 2024
Merged

RCPP-41 Add Conan support #174

merged 18 commits into from
Mar 22, 2024

Conversation

leemaguire
Copy link
Contributor

@leemaguire leemaguire commented Mar 7, 2024

This PR adds the relevant conanfiles and is a prerequisite before being added to the Conan Centre Index.

You can install cpprealm locally with conan install . from the project source dir.

@leemaguire leemaguire self-assigned this Mar 7, 2024
@leemaguire leemaguire force-pushed the lm/packaging branch 2 times, most recently from 7735490 to 2e4a070 Compare March 13, 2024 16:06
@leemaguire leemaguire marked this pull request as ready for review March 21, 2024 14:22
conanfile.py Outdated
git = Git(self)
git.clone(url="https://github.com/realm/realm-cpp", target=".")
git.folder = "."
git.checkout(commit="316c31841b56fab7fe1f28f0aa0138e00f10a8cb")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This temporarily points to the changelog commit in this PR. This should point to a v2.0.0 tag in the future

@leemaguire leemaguire requested a review from fealebenpae March 22, 2024 10:51
tests/CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated
@@ -127,7 +127,12 @@ else()
endif()

if(MSVC AND NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
if(NOT DEFINED BUILD_SHARED_LIBS OR NOT BUILD_SHARED_LIBS)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if(NOT DEFINED BUILD_SHARED_LIBS OR NOT BUILD_SHARED_LIBS)
if(NOT BUILD_SHARED_LIBS)

If BUILD_SHARED_LIBS is undefined it will evaluate to false anyway.

Copy link
Member

Choose a reason for hiding this comment

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

In any case, Conan already seems to define CMAKE_MSVC_RUNTIME_LIBRARY, why is the extra condition here necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for building with plain cmake or from vcpkg, conan handles this for us.

Copy link
Member

Choose a reason for hiding this comment

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

vcpkg also sets it

I guess the intention is to default to the shared runtime library instead of the static one? The shared one is default behavior, so I think you could simplify this to if (not defined CMAKE_MSVC_RUNTIME_LIBRARY) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL") endif(), but we can also do this in a second pass just to clarify our behavior around CMAKE_MSVC_RUNTIME_LIBRARY.

@leemaguire leemaguire requested a review from fealebenpae March 22, 2024 15:06
@leemaguire leemaguire merged commit 4cd8034 into main Mar 22, 2024
49 of 58 checks passed
@leemaguire leemaguire deleted the lm/packaging branch March 22, 2024 15:36
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants