On 3/5/07, Christopher Armstrong <[EMAIL PROTECTED]> wrote:
> Before showing what these hacks are (if you really care, you can check
> the various setup.py files in the Twisted repository), I'd like to ask
> if there is any other best-practice knowledge in the community for
> conditionally building extensions based on knowledge only available by
> using a compiler.


Ok, here's what I think I'm going to do.

Subclass Extension to have an extra method, shouldBuild, which is
called by build_extension by my subclass of build_ext. It will filter
out any extensions for which shouldBuild returns False. This way
extensions will still be declared ahead of time and so no early-out
code will be problematic.

Probably my subclass of Extension will take a callable in its
initializer to use as the default implementation of shouldBuild.

I'll try this out soon.

-- 
Christopher Armstrong
International Man of Twistery
http://radix.twistedmatrix.com/
http://twistedmatrix.com/
http://canonical.com/
_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to