中文简体 | English
Configurable CMake options are centralized in cmake/Options.cmake. During configuration, Camel prints a ============ Build options: ============ block so local and CI builds are easy to compare.
| Mechanism | Role |
|---|---|
cmake/options.json |
Canonical list and defaults (used by scripts and npm run config) |
.camel-opts.json |
Persistent user overrides; created from options.json on first npm run config or build script run |
npm run config |
Toggles ON/OFF interactively and writes .camel-opts.json |
npm run build / debug / profile |
Reads the above via scripts/cmake-opts.js and passes -D<NAME>=<ON|OFF> to CMake |
When invoking CMake directly, you can pass -DENABLE_FASTVM_JIT=OFF etc.; unspecified options use the option() defaults in Options.cmake.
Names match the configure log (booleans are CMake ON / OFF).
- Meaning: Enable FastVM JIT (native code generation) on supported x64 targets.
- Note: On non-x64 or when disabled, the log shows
OFF(with a platform note when applicable). - Implementation:
add_platform_optionsets compile definitions such asENABLE_FASTVM_JITandJIT_TARGET_X64.
- Meaning: Use computed goto (label-value dispatch) in the FastVM interpreter.
- Implementation:
add_bool_option, injectingENABLE_FASTVM_COMPUTED_GOTO=0|1oncamel_options.
- Meaning: Build Python embedding artifacts:
python.cmo,pyplot.cmo,py_bridge*, etc. Requires a Python development layout (headers and import library; seemodules/pythonprobing). - Implementation: Plain
option()— notadd_bool_option, so there is no globalCAMEL_ENABLE_PYTHON=0|1preprocessor macro; it only controlsadd_subdirectory(modules/python)and, when dev is available,modules/pyplot. - Environment override: If
CAMEL_SKIP_PYTHONis set to1,ON,YES, orTRUE(seeOptions.cmakefor the exact pattern),CAMEL_ENABLE_PYTHONis forced toOFFat configure time (cache write; overrides prior cache). Useful for CI or builds that do not need Python modules.
- If
modules/pythoncannot buildpython.cmo, it skips; whenCAMEL_PYTHON_DEV_AVAILABLEis false, the rootCMakeLists.txtdoes not addmodules/pyplot, avoiding a failingfind_package(Python3 REQUIRED).
Booleans are cached. If CAMEL_ENABLE_PYTHON was turned off, re-enable it by:
- Passing
-DCAMEL_ENABLE_PYTHON=ON, or - Setting
"ON"in.camel-opts.json, or - Removing the
build/tree (or your build directory) and reconfiguring.
Clearing or unsetting CAMEL_SKIP_PYTHON alone does not flip a cached OFF back to ON; use one of the steps above.
AGENTS.md(repo root): build commands, runtime env (CAMEL_HOME, etc.), logging — complements CMake options.docs/npm-scripts.md:npm run configand build scripts.docs/pypi-packaging.md: PyPI wheel layout vs SDK embedding (where strategies differ).