Optional Integration

Default build has Scapix disabled

Even with Scapix integrated into C++ project, the default build of the project has Scapix disabled: when CMake parameter SCAPIX_BRIDGE=<Lang> is not specified, it defaults to SCAPIX_BRIDGE=cpp (i.e. bridge C++ to C++), in which case scapix::bridge::object<> becomes an empty class and project builds normally without any overhead.

Make integration completely optional

If the above approach is not enough, you can make Scapix integration completely optional by using your own intermediary base class instead of deriving directly from scapix::bridge::object<>.

#ifdef SCAPIX_BRIDGE

#include <scapix/bridge/object.h>

template <typename T>
using base_object = scapix::bridge::object<T>;

#else

template <typename T>
class base_object {};

#endif

This way, your project will be using Scapix when building from CMake with Scapix integration, but can also be used normally (without Scapix) in all other cases.