realm-core
realm-core copied to clipboard
Add a CMake option to disable compilation of the FFI / C-API
For SDKs that don't use the FFI / C-API (such as the JS SDK), it would be great to cut down compilation time if we could configure the CMake project to avoid generating targets for the FFI / C-API. I imagine we'd add option(REALM_ENABLE_FFI "Enabled the ffi c-api" ON)
around here:
https://github.com/realm/realm-core/blob/e7285a374e3f497a0b2fd6fb1d5d535486c8bfbc/CMakeLists.txt#L256-L269
And use that option to either:
- Conditionally add the c_api subdirectory here: https://github.com/realm/realm-core/blob/master/src/realm/object-store/CMakeLists.txt#L1
- Alternatively, conditionally set
EXCLUDE_FROM_ALL
toON
for theRealmFFI
(already has this on) andRealmFFIStatic
targets, around here https://github.com/realm/realm-core/blob/e7285a374e3f497a0b2fd6fb1d5d535486c8bfbc/src/realm/object-store/c_api/CMakeLists.txt#L65-L80