Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

An add-on for setuptools to simplify building executables and static libraries

Project Description

Distutils/Setuptools provides a fantastic cross platform framework for building python packages, including binary extensions using your platforms standard c/c++ compiler.

Why should it be limited only to use on python pyd extensions however, there’s nothing to stop it being used for compiling anything with said comiler, such as executables and static libraries.

Well it turns out all the functionality is already there, it just isn’t really exposed to the end user very easily. This is easily rectified however:

from setuptools import setup
from ext_targets import build_ext, StaticLib, Executable


setup(
    name='binaries!',  # This isn't actually used in the built targets
    cmdclass={'build_ext': build_ext},
    ext_modules=ext_modules = [
        StaticLib(
            name='saveforlater',
            sources=['lib.c', 'required.c'],
            include_dirs=['../include']
        ),
        Executable(
            name='my_program',
            sources=['source.c', 'extra.cpp'],
            libraries=['libsaveforlater']
            language='c++',
            include_dirs=['../include'],
            extra_compile_args=['-static'],
            extra_link_args=['-static']
        )
    ]
)

Release History

This version
History Node

1.3

History Node

1.2

History Node

1.1

History Node

1.0

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
setuptools_bin_targets-1.3.tar.gz
(3.0 kB) Copy SHA256 Hash SHA256
Source None Mar 19, 2017

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting