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

fixed CMake Error given target "Sync" which does not exist #243

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ahaladok
Copy link

@ahaladok ahaladok commented Dec 4, 2024

Issue Description

The CMake configuration process fails due to a non-existent target Sync being included in INSTALL_TARGETS when REALM_ENABLE_SYNC=OFF. The target Sync should only be appended to INSTALL_TARGETS if synchronization is enabled.

Repro Steps

  1. Configure the build with the following options:
   cmake -B build . \
       -D CMAKE_BUILD_TYPE=Release \
       -D REALM_ENABLE_SYNC=OFF

What Happened?

The build fails with the following error:

CMake Error at src/CMakeLists.txt:159 (install):
  install TARGETS given target "Sync" which does not exist.

The target Sync is being appended to INSTALL_TARGETS unconditionally, without checking if it has been created. When REALM_ENABLE_SYNC=OFF, the Sync target is not defined, causing the error during the installation phase.

Fix Proposal

Update the src/CMakeLists.txt to conditionally append the Sync target only if it has been created. The following changes are required:

set(INSTALL_TARGETS ObjectStore Storage QueryParser)
if (REALM_ENABLE_SYNC)
    list(APPEND INSTALL_TARGETS Sync)
endif()

This ensures that the Sync target is only included when REALM_ENABLE_SYNC=ON, avoiding errors during installation when synchronization is disabled.

Version

  • Realm C++ version: 2.2.0
  • Installation method: CMake

Atlas Services in Use

  • Local Database only

Compiler

  • AppleClang 16.0.0.16000026

OS and Version

  • Sequoia 15.1

Code Snippets

Relevant code snippet causing the issue:

set(INSTALL_TARGETS ObjectStore Storage QueryParser Sync)

Stacktrace of the Exception/Crash

CMake Error at src/CMakeLists.txt:159 (install):
install TARGETS given target "Sync" which does not exist.

Relevant Log Output

No additional log output provided.

…S given target "Sync" which does not exist. while -D REALM_ENABLE_SYNC=OFF
@ahaladok ahaladok changed the title fixed CMake Error at src/CMakeLists.txt:159 (install): install TARGET… fixed CMake Error given target "Sync" which does not exist Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant