cmake: rename MOMO_BUILD_AS_LIBRARY to SOGEN_BUILD_STATIC

Also adds FATAL_ERROR guard when SOGEN_STATIC_CRT=ON without SOGEN_BUILD_STATIC=ON,
since static CRT with shared libraries causes heap corruption (each DLL gets its own
allocator but sogen passes ownership across boundaries).

These options are designed to be used together for full static linking, useful for
embedding sogen in projects like IDA Pro plugins.
This commit is contained in:
Elias Bachaalany
2025-12-02 16:24:27 -08:00
parent d4166a5c8d
commit 7a42bc7ad3
7 changed files with 16 additions and 9 deletions

View File

@@ -44,7 +44,7 @@ endif()
##########################################
option(MOMO_BUILD_AS_LIBRARY "Configure and Build the sogen as a shared library (without the samples and tests)" ${MOMO_IS_SUBPROJECT})
option(SOGEN_BUILD_STATIC "Build sogen as static libraries for embedding (e.g., IDA plugins)" ${MOMO_IS_SUBPROJECT})
##########################################