mirror of
https://github.com/boostorg/python.git
synced 2026-01-22 17:32:55 +00:00
Merge pull request #36 from ChrislS/master
SCons change to build a static lib for Windows
This commit is contained in:
@@ -6,9 +6,15 @@
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
import sys
|
||||
import os
|
||||
VERSION = sys.version_info.major
|
||||
import sysconfig
|
||||
EXT_SUFFIX = sysconfig.get_config_var("EXT_SUFFIX")
|
||||
if os.name == 'nt':
|
||||
EXT_SUFFIX = '.dll'
|
||||
LIB_SUFFIX = '.lib'
|
||||
else:
|
||||
EXT_SUFFIX = sysconfig.get_config_var("EXT_SUFFIX")
|
||||
LIB_SUFFIX = EXT_SUFFIX
|
||||
|
||||
if VERSION == 2 and EXT_SUFFIX == 'None' or EXT_SUFFIX==None:
|
||||
EXT_SUFFIX = '.so'
|
||||
@@ -20,10 +26,13 @@ OBJ_SUFFIX = EXT_SUFFIX.replace ('.so', '.os')
|
||||
|
||||
Import("env")
|
||||
|
||||
LIB_BOOST_NUMPY = ('boost_numpy' + EXT_SUFFIX)
|
||||
LIB_BOOST_NUMPY = ('boost_numpy' + LIB_SUFFIX)
|
||||
mods = [g.name.replace('.cpp', '') for g in Glob("*.cpp")]
|
||||
for m in mods:
|
||||
env.SharedObject (target=m+OBJ_SUFFIX, source=m+'.cpp')
|
||||
lib = env.SharedLibrary(LIB_BOOST_NUMPY, source=[m+OBJ_SUFFIX for m in mods])
|
||||
if os.name == 'nt':
|
||||
lib = env.StaticLibrary(LIB_BOOST_NUMPY, source=[m+OBJ_SUFFIX for m in mods])
|
||||
else:
|
||||
lib = env.SharedLibrary(LIB_BOOST_NUMPY, source=[m+OBJ_SUFFIX for m in mods])
|
||||
|
||||
Return("lib")
|
||||
|
||||
Reference in New Issue
Block a user