nitroHideLibcxxBlock top-level constant

String const nitroHideLibcxxBlock

Lines of src/CMakeLists.txt that pull in nitroLibcxxCmakeModule. Hiding the static libc++ took a scaffolded arm64 library from 256 KB to 111 KB (#68).

Implementation

const String nitroHideLibcxxBlock =
    '# ── Android: keep the static libc++ private ──────────────────────────────────\n'
    '# The NDK links libc++ statically into each library below and by default\n'
    '# re-exports every libc++ symbol from it, which also stops the linker dropping\n'
    '# the unused ones (about 150 KB per ABI). The included file hides them, but\n'
    '# only in a project whose libraries share their libc++ with no other library.\n'
    '# Comment the include out to keep them exported.\n'
    'include("\${CMAKE_CURRENT_SOURCE_DIR}/native/$nitroLibcxxCmakeFile" OPTIONAL)\n';