fixed CMake Error given target "Sync" which does not exist #243
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Description
The CMake configuration process fails due to a non-existent target
Sync
being included inINSTALL_TARGETS
whenREALM_ENABLE_SYNC=OFF
. The targetSync
should only be appended toINSTALL_TARGETS
if synchronization is enabled.Repro Steps
What Happened?
The build fails with the following error:
The target
Sync
is being appended toINSTALL_TARGETS
unconditionally, without checking if it has been created. WhenREALM_ENABLE_SYNC=OFF
, theSync
target is not defined, causing the error during the installation phase.Fix Proposal
Update the
src/CMakeLists.txt
to conditionally append theSync
target only if it has been created. The following changes are required:This ensures that the
Sync
target is only included whenREALM_ENABLE_SYNC=ON
, avoiding errors during installation when synchronization is disabled.Version
2.2.0
CMake
Atlas Services in Use
Compiler
OS and Version
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.