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

Don't allow Core targets to be installed if submodule #7379

Merged
merged 3 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(RealmCore)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake")

if(NOT CMAKE_SOURCE_DIR STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
if(NOT DEFINED REALM_CORE_SUBMODULE_BUILD AND NOT CMAKE_SOURCE_DIR STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
# Realm Core is being built as part of another project, likely an SDK
set(REALM_CORE_SUBMODULE_BUILD ON)
endif()
Expand Down Expand Up @@ -361,6 +361,11 @@ add_subdirectory(bindgen)
# Install the licence and changelog files
install(FILES LICENSE CHANGELOG.md DESTINATION "doc/realm" COMPONENT devel)

# Only prepare test/install/package targets if we're not a submodule
if(REALM_CORE_SUBMODULE_BUILD)
return()
endif()

# Make the project importable from the build directory
set(REALM_EXPORTED_TARGETS
Storage
Expand Down Expand Up @@ -394,11 +399,6 @@ install(FILES tools/cmake/AcquireRealmDependency.cmake
COMPONENT devel
)

# Only prepare test/install/package targets if we're not a submodule
if(REALM_CORE_SUBMODULE_BUILD)
return()
endif()

if(CMAKE_SYSTEM_NAME MATCHES "^Windows")
# Increase the Catch2 virtual console width because our test names can be very long and they break test reports
set(CATCH_CONFIG_CONSOLE_WIDTH 300)
Expand Down
2 changes: 1 addition & 1 deletion bindgen/src/realm_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ struct Helpers {
{
size_t max_size = util::base64_decoded_size(input.size());
std::unique_ptr<char[]> data(new char[max_size]);
if (auto size = util::base64_decode(input, data.get(), max_size)) {
if (auto size = util::base64_decode(input, {data.get(), max_size})) {
OwnedBinaryData result(std::move(data), *size);
return result;
}
Expand Down
Loading