Compile the Python interpreter statically?

后端 未结 4 2147
时光说笑
时光说笑 2020-11-27 12:28

I\'m building a special-purpose embedded Python interpreter and want to avoid having dependencies on dynamic libraries so I want to compile the interpreter with static libra

4条回答
  •  囚心锁ツ
    2020-11-27 12:53

    CPython CMake Buildsystem offers an alternative way to build Python, using CMake.

    It can build python lib statically, and include in that lib all the modules you want. Just set CMake's options

    BUILD_SHARED                     OFF
    BUILD_STATIC                     ON
    

    and set the BUILTIN_ you want to ON.

提交回复
热议问题