How can I run a Makefile in setup.py?

前端 未结 3 1100
借酒劲吻你
借酒劲吻你 2021-01-30 17:13

I need to compile ICU using it\'s own build mechanism. Therefore the question:

How can I run a Makefile from setup.py? Obviously, I only want it to run duri

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-30 17:33

    If you are building a python extension you can use the distutils/setuptools Extensions. For example:

    from setuptools import Extension
    # or:
    # from distutils.extension import Extension
    setup(...
          ext_modules = [Extension("pkg.icu",
                                   ["icu-sqlite/icu.c"]),
                        ]
          )
    

    There are lots of options to build extensions, see the docs: http://docs.python.org/distutils/setupscript.html

提交回复
热议问题