|
@@ -150,7 +150,7 @@ CONFLICTING_FILES=["dtool/src/dtoolutil/pandaVersion.h",
|
|
|
def WarnConflictingFiles(delete = False):
|
|
def WarnConflictingFiles(delete = False):
|
|
|
for cfile in CONFLICTING_FILES:
|
|
for cfile in CONFLICTING_FILES:
|
|
|
if os.path.exists(cfile):
|
|
if os.path.exists(cfile):
|
|
|
- print("%sWARNING:%s file may conflict with build: %s%s%s" % (GetColor("red"), GetColor(), GetColor("green"), cfile, GetColor()))
|
|
|
|
|
|
|
+ Warn("file may conflict with build:", cfile)
|
|
|
if delete:
|
|
if delete:
|
|
|
os.unlink(cfile)
|
|
os.unlink(cfile)
|
|
|
print("Deleted.")
|
|
print("Deleted.")
|
|
@@ -284,6 +284,20 @@ def exit(msg = ""):
|
|
|
print(msg)
|
|
print(msg)
|
|
|
raise "initiate-exit"
|
|
raise "initiate-exit"
|
|
|
|
|
|
|
|
|
|
+def Warn(msg, extra=None):
|
|
|
|
|
+ if extra is not None:
|
|
|
|
|
+ print("%sWARNING:%s %s %s%s%s" % (GetColor("red"), GetColor(), msg, GetColor("green"), extra, GetColor()))
|
|
|
|
|
+ else:
|
|
|
|
|
+ print("%sWARNING:%s %s" % (GetColor("red"), GetColor(), msg))
|
|
|
|
|
+ sys.stdout.flush()
|
|
|
|
|
+
|
|
|
|
|
+def Error(msg, extra=None):
|
|
|
|
|
+ if extra is not None:
|
|
|
|
|
+ print("%sERROR:%s %s %s%s%s" % (GetColor("red"), GetColor(), msg, GetColor("green"), extra, GetColor()))
|
|
|
|
|
+ else:
|
|
|
|
|
+ print("%sERROR:%s %s" % (GetColor("red"), GetColor(), msg))
|
|
|
|
|
+ exit()
|
|
|
|
|
+
|
|
|
########################################################################
|
|
########################################################################
|
|
|
##
|
|
##
|
|
|
## SetTarget, GetTarget, GetHost
|
|
## SetTarget, GetTarget, GetHost
|
|
@@ -723,7 +737,7 @@ def NeedsBuild(files, others):
|
|
|
print(" dependency changed: %s" % (key))
|
|
print(" dependency changed: %s" % (key))
|
|
|
|
|
|
|
|
if VERBOSE and frozenset(cached) != frozenset(dates):
|
|
if VERBOSE and frozenset(cached) != frozenset(dates):
|
|
|
- print("%sWARNING:%s file dependencies changed: %s%s%s" % (GetColor("red"), GetColor(), GetColor("green"), files, GetColor()))
|
|
|
|
|
|
|
+ Warn("file dependencies changed:", files)
|
|
|
|
|
|
|
|
return True
|
|
return True
|
|
|
|
|
|
|
@@ -1298,7 +1312,7 @@ def GetThirdpartyDir():
|
|
|
THIRDPARTYDIR = GetThirdpartyBase()+"/android-libs-%s/" % (GetTargetArch())
|
|
THIRDPARTYDIR = GetThirdpartyBase()+"/android-libs-%s/" % (GetTargetArch())
|
|
|
|
|
|
|
|
else:
|
|
else:
|
|
|
- print("%s Unsupported platform: %s" % (ColorText("red", "WARNING:"), target))
|
|
|
|
|
|
|
+ Warn("Unsupported platform:", target)
|
|
|
return
|
|
return
|
|
|
|
|
|
|
|
if (GetVerbose()):
|
|
if (GetVerbose()):
|
|
@@ -1744,11 +1758,10 @@ def SmartPkgEnable(pkg, pkgconfig = None, libs = None, incs = None, defs = None,
|
|
|
if not custom_loc and pkgconfig is not None and not libs:
|
|
if not custom_loc and pkgconfig is not None and not libs:
|
|
|
# pkg-config is all we can do, abort if it wasn't found.
|
|
# pkg-config is all we can do, abort if it wasn't found.
|
|
|
if pkg in PkgListGet():
|
|
if pkg in PkgListGet():
|
|
|
- print("%sWARNING:%s Could not locate pkg-config package %s, excluding from build" % (GetColor("red"), GetColor(), pkgconfig))
|
|
|
|
|
|
|
+ Warn("Could not locate pkg-config package %s, excluding from build" % (pkgconfig))
|
|
|
PkgDisable(pkg)
|
|
PkgDisable(pkg)
|
|
|
else:
|
|
else:
|
|
|
- print("%sERROR:%s Could not locate pkg-config package %s, aborting build" % (GetColor("red"), GetColor(), pkgconfig))
|
|
|
|
|
- exit()
|
|
|
|
|
|
|
+ Error("Could not locate pkg-config package %s, aborting build" % (pkgconfig))
|
|
|
|
|
|
|
|
else:
|
|
else:
|
|
|
# Okay, our pkg-config attempts failed. Let's try locating the libs by ourselves.
|
|
# Okay, our pkg-config attempts failed. Let's try locating the libs by ourselves.
|
|
@@ -1812,14 +1825,12 @@ def SmartPkgEnable(pkg, pkgconfig = None, libs = None, incs = None, defs = None,
|
|
|
|
|
|
|
|
if not have_pkg:
|
|
if not have_pkg:
|
|
|
if custom_loc:
|
|
if custom_loc:
|
|
|
- print("%sERROR:%s Could not locate thirdparty package %s in specified directory, aborting build" % (GetColor("red"), GetColor(), pkg.lower()))
|
|
|
|
|
- exit()
|
|
|
|
|
|
|
+ Error("Could not locate thirdparty package %s in specified directory, aborting build" % (pkg.lower()))
|
|
|
elif pkg in PkgListGet():
|
|
elif pkg in PkgListGet():
|
|
|
- print("%sWARNING:%s Could not locate thirdparty package %s, excluding from build" % (GetColor("red"), GetColor(), pkg.lower()))
|
|
|
|
|
|
|
+ Warn("Could not locate thirdparty package %s, excluding from build" % (pkg.lower()))
|
|
|
PkgDisable(pkg)
|
|
PkgDisable(pkg)
|
|
|
else:
|
|
else:
|
|
|
- print("%sERROR:%s Could not locate thirdparty package %s, aborting build" % (GetColor("red"), GetColor(), pkg.lower()))
|
|
|
|
|
- exit()
|
|
|
|
|
|
|
+ Error("Could not locate thirdparty package %s, aborting build" % (pkg.lower()))
|
|
|
|
|
|
|
|
########################################################################
|
|
########################################################################
|
|
|
##
|
|
##
|
|
@@ -2100,7 +2111,7 @@ def SdkLocatePython(prefer_thirdparty_python=False):
|
|
|
os.environ["PYTHONHOME"] = SDK["PYTHON"]
|
|
os.environ["PYTHONHOME"] = SDK["PYTHON"]
|
|
|
|
|
|
|
|
if sys.version[:3] != ver:
|
|
if sys.version[:3] != ver:
|
|
|
- print("Warning: running makepanda with Python %s, but building Panda3D with Python %s." % (sys.version[:3], ver))
|
|
|
|
|
|
|
+ Warn("running makepanda with Python %s, but building Panda3D with Python %s." % (sys.version[:3], ver))
|
|
|
|
|
|
|
|
elif CrossCompiling() or (prefer_thirdparty_python and os.path.isdir(os.path.join(GetThirdpartyDir(), "python"))):
|
|
elif CrossCompiling() or (prefer_thirdparty_python and os.path.isdir(os.path.join(GetThirdpartyDir(), "python"))):
|
|
|
tp_python = os.path.join(GetThirdpartyDir(), "python")
|
|
tp_python = os.path.join(GetThirdpartyDir(), "python")
|
|
@@ -2743,12 +2754,11 @@ def LibName(opt, name):
|
|
|
WARNINGS.append(name + " not found. Skipping Package " + opt)
|
|
WARNINGS.append(name + " not found. Skipping Package " + opt)
|
|
|
if (opt in PkgListGet()):
|
|
if (opt in PkgListGet()):
|
|
|
if not PkgSkip(opt):
|
|
if not PkgSkip(opt):
|
|
|
- print("%sWARNING:%s Could not locate thirdparty package %s, excluding from build" % (GetColor("red"), GetColor(), opt.lower()))
|
|
|
|
|
|
|
+ Warn("Could not locate thirdparty package %s, excluding from build" % (opt.lower()))
|
|
|
PkgDisable(opt)
|
|
PkgDisable(opt)
|
|
|
return
|
|
return
|
|
|
else:
|
|
else:
|
|
|
- print("%sERROR:%s Could not locate thirdparty package %s, aborting build" % (GetColor("red"), GetColor(), opt.lower()))
|
|
|
|
|
- exit()
|
|
|
|
|
|
|
+ Error("Could not locate thirdparty package %s, aborting build" % (opt.lower()))
|
|
|
LIBNAMES.append((opt, name))
|
|
LIBNAMES.append((opt, name))
|
|
|
|
|
|
|
|
def DefSymbol(opt, sym, val=""):
|
|
def DefSymbol(opt, sym, val=""):
|
|
@@ -2831,7 +2841,7 @@ def SetupBuildEnvironment(compiler):
|
|
|
|
|
|
|
|
returnval = handle.close()
|
|
returnval = handle.close()
|
|
|
if returnval != None and returnval != 0:
|
|
if returnval != None and returnval != 0:
|
|
|
- print("%sWARNING:%s %s failed" % (GetColor("red"), GetColor(), cmd))
|
|
|
|
|
|
|
+ Warn("%s failed" % (cmd))
|
|
|
SYS_LIB_DIRS += [SDK.get("SYSROOT", "") + "/usr/lib"]
|
|
SYS_LIB_DIRS += [SDK.get("SYSROOT", "") + "/usr/lib"]
|
|
|
|
|
|
|
|
# Now extract the preprocessor's include directories.
|
|
# Now extract the preprocessor's include directories.
|
|
@@ -2860,7 +2870,7 @@ def SetupBuildEnvironment(compiler):
|
|
|
print("Ignoring non-existent include directory %s" % (line))
|
|
print("Ignoring non-existent include directory %s" % (line))
|
|
|
|
|
|
|
|
if handle.returncode != 0 or not SYS_INC_DIRS:
|
|
if handle.returncode != 0 or not SYS_INC_DIRS:
|
|
|
- print("%sWARNING:%s %s failed or did not produce the expected result" % (GetColor("red"), GetColor(), cmd))
|
|
|
|
|
|
|
+ Warn("%s failed or did not produce the expected result" % (cmd))
|
|
|
sysroot = SDK.get("SYSROOT", "")
|
|
sysroot = SDK.get("SYSROOT", "")
|
|
|
# Add some sensible directories as a fallback.
|
|
# Add some sensible directories as a fallback.
|
|
|
SYS_INC_DIRS = [
|
|
SYS_INC_DIRS = [
|
|
@@ -3190,6 +3200,48 @@ def WriteResourceFile(basename, **kwargs):
|
|
|
ConditionalWriteFile(basename, GenerateResourceFile(**kwargs))
|
|
ConditionalWriteFile(basename, GenerateResourceFile(**kwargs))
|
|
|
return basename
|
|
return basename
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+def WriteEmbeddedStringFile(basename, inputs, string_name=None):
|
|
|
|
|
+ if os.path.splitext(basename)[1] not in SUFFIX_INC:
|
|
|
|
|
+ basename += '.cxx'
|
|
|
|
|
+ target = GetOutputDir() + "/tmp/" + basename
|
|
|
|
|
+
|
|
|
|
|
+ if string_name is None:
|
|
|
|
|
+ string_name = os.path.basename(os.path.splitext(target)[0])
|
|
|
|
|
+ string_name = string_name.replace('-', '_')
|
|
|
|
|
+
|
|
|
|
|
+ data = bytearray()
|
|
|
|
|
+ for input in inputs:
|
|
|
|
|
+ fp = open(input, 'rb')
|
|
|
|
|
+
|
|
|
|
|
+ # Insert a #line so that we get meaningful compile/assert errors when
|
|
|
|
|
+ # the result is inserted by interrogate_module into generated code.
|
|
|
|
|
+ if os.path.splitext(input)[1] in SUFFIX_INC:
|
|
|
|
|
+ line = '#line 1 "%s"\n' % (input)
|
|
|
|
|
+ data += bytearray(line.encode('ascii', 'replace'))
|
|
|
|
|
+
|
|
|
|
|
+ data += bytearray(fp.read())
|
|
|
|
|
+ fp.close()
|
|
|
|
|
+
|
|
|
|
|
+ data.append(0)
|
|
|
|
|
+
|
|
|
|
|
+ output = 'extern const char %s[] = {\n' % (string_name)
|
|
|
|
|
+
|
|
|
|
|
+ i = 0
|
|
|
|
|
+ for byte in data:
|
|
|
|
|
+ if i == 0:
|
|
|
|
|
+ output += ' '
|
|
|
|
|
+
|
|
|
|
|
+ output += ' 0x%02x,' % (byte)
|
|
|
|
|
+ i += 1
|
|
|
|
|
+ if i >= 12:
|
|
|
|
|
+ output += '\n'
|
|
|
|
|
+ i = 0
|
|
|
|
|
+
|
|
|
|
|
+ output += '\n};\n'
|
|
|
|
|
+ ConditionalWriteFile(target, output)
|
|
|
|
|
+ return target
|
|
|
|
|
+
|
|
|
########################################################################
|
|
########################################################################
|
|
|
##
|
|
##
|
|
|
## FindLocation
|
|
## FindLocation
|
|
@@ -3197,6 +3249,8 @@ def WriteResourceFile(basename, **kwargs):
|
|
|
########################################################################
|
|
########################################################################
|
|
|
|
|
|
|
|
ORIG_EXT = {}
|
|
ORIG_EXT = {}
|
|
|
|
|
+PYABI_SPECIFIC = set()
|
|
|
|
|
+WARNED_FILES = set()
|
|
|
|
|
|
|
|
def GetOrigExt(x):
|
|
def GetOrigExt(x):
|
|
|
return ORIG_EXT[x]
|
|
return ORIG_EXT[x]
|
|
@@ -3206,15 +3260,37 @@ def SetOrigExt(x, v):
|
|
|
|
|
|
|
|
def GetExtensionSuffix():
|
|
def GetExtensionSuffix():
|
|
|
if sys.version_info >= (3, 0):
|
|
if sys.version_info >= (3, 0):
|
|
|
- suffix = sysconfig.get_config_var('EXT_SUFFIX')
|
|
|
|
|
- if suffix:
|
|
|
|
|
- return suffix
|
|
|
|
|
|
|
+ import _imp
|
|
|
|
|
+ return _imp.extension_suffixes()[0]
|
|
|
|
|
+
|
|
|
target = GetTarget()
|
|
target = GetTarget()
|
|
|
if target == 'windows':
|
|
if target == 'windows':
|
|
|
return '.pyd'
|
|
return '.pyd'
|
|
|
else:
|
|
else:
|
|
|
return '.so'
|
|
return '.so'
|
|
|
|
|
|
|
|
|
|
+def GetPythonABI():
|
|
|
|
|
+ soabi = sysconfig.get_config_var('SOABI')
|
|
|
|
|
+ if soabi:
|
|
|
|
|
+ return soabi
|
|
|
|
|
+
|
|
|
|
|
+ soabi = 'cpython-%d%d' % (sys.version_info[:2])
|
|
|
|
|
+
|
|
|
|
|
+ debug_flag = sysconfig.get_config_var('Py_DEBUG')
|
|
|
|
|
+ if (debug_flag is None and hasattr(sys, 'gettotalrefcount')) or debug_flag:
|
|
|
|
|
+ soabi += 'd'
|
|
|
|
|
+
|
|
|
|
|
+ malloc_flag = sysconfig.get_config_var('WITH_PYMALLOC')
|
|
|
|
|
+ if malloc_flag is None or malloc_flag:
|
|
|
|
|
+ soabi += 'm'
|
|
|
|
|
+
|
|
|
|
|
+ if sys.version_info < (3, 3):
|
|
|
|
|
+ usize = sysconfig.get_config_var('Py_UNICODE_SIZE')
|
|
|
|
|
+ if (usize is None and sys.maxunicode == 0x10ffff) or usize == 4:
|
|
|
|
|
+ soabi += 'u'
|
|
|
|
|
+
|
|
|
|
|
+ return soabi
|
|
|
|
|
+
|
|
|
def CalcLocation(fn, ipath):
|
|
def CalcLocation(fn, ipath):
|
|
|
if fn.startswith("panda3d/") and fn.endswith(".py"):
|
|
if fn.startswith("panda3d/") and fn.endswith(".py"):
|
|
|
return OUTPUTDIR + "/" + fn
|
|
return OUTPUTDIR + "/" + fn
|
|
@@ -3285,11 +3361,25 @@ def CalcLocation(fn, ipath):
|
|
|
return fn
|
|
return fn
|
|
|
|
|
|
|
|
|
|
|
|
|
-def FindLocation(fn, ipath):
|
|
|
|
|
|
|
+def FindLocation(fn, ipath, pyabi=None):
|
|
|
if (GetLinkAllStatic() and fn.endswith(".dll")):
|
|
if (GetLinkAllStatic() and fn.endswith(".dll")):
|
|
|
fn = fn[:-4] + ".lib"
|
|
fn = fn[:-4] + ".lib"
|
|
|
loc = CalcLocation(fn, ipath)
|
|
loc = CalcLocation(fn, ipath)
|
|
|
base, ext = os.path.splitext(fn)
|
|
base, ext = os.path.splitext(fn)
|
|
|
|
|
+
|
|
|
|
|
+ # If this is a target created with PyTargetAdd, we need to make sure it
|
|
|
|
|
+ # it put in a Python-version-specific directory.
|
|
|
|
|
+ if loc in PYABI_SPECIFIC:
|
|
|
|
|
+ if loc.startswith(OUTPUTDIR + "/tmp"):
|
|
|
|
|
+ if pyabi is not None:
|
|
|
|
|
+ loc = OUTPUTDIR + "/tmp/" + pyabi + loc[len(OUTPUTDIR) + 4:]
|
|
|
|
|
+ else:
|
|
|
|
|
+ raise RuntimeError("%s is a Python-specific target, use PyTargetAdd instead of TargetAdd" % (fn))
|
|
|
|
|
+
|
|
|
|
|
+ elif ext != ".pyd" and loc not in WARNED_FILES:
|
|
|
|
|
+ WARNED_FILES.add(loc)
|
|
|
|
|
+ Warn("file depends on Python but is not in an ABI-specific directory:", loc)
|
|
|
|
|
+
|
|
|
ORIG_EXT[loc] = ext
|
|
ORIG_EXT[loc] = ext
|
|
|
return loc
|
|
return loc
|
|
|
|
|
|
|
@@ -3335,6 +3425,11 @@ def FindLocation(fn, ipath):
|
|
|
## be inserted: bison generates an OBJ and a secondary header
|
|
## be inserted: bison generates an OBJ and a secondary header
|
|
|
## file, interrogate generates an IN and a secondary IGATE.OBJ.
|
|
## file, interrogate generates an IN and a secondary IGATE.OBJ.
|
|
|
##
|
|
##
|
|
|
|
|
+## PyTargetAdd is a special version for targets that depend on Python.
|
|
|
|
|
+## It will create a target for each Python version we are building with,
|
|
|
|
|
+## ensuring that builds with different Python versions won't conflict
|
|
|
|
|
+## when we build for multiple Python ABIs side-by-side.
|
|
|
|
|
+##
|
|
|
########################################################################
|
|
########################################################################
|
|
|
|
|
|
|
|
class Target:
|
|
class Target:
|
|
@@ -3343,7 +3438,7 @@ class Target:
|
|
|
TARGET_LIST = []
|
|
TARGET_LIST = []
|
|
|
TARGET_TABLE = {}
|
|
TARGET_TABLE = {}
|
|
|
|
|
|
|
|
-def TargetAdd(target, dummy=0, opts=[], input=[], dep=[], ipath=None, winrc=None):
|
|
|
|
|
|
|
+def TargetAdd(target, dummy=0, opts=[], input=[], dep=[], ipath=None, winrc=None, pyabi=None):
|
|
|
if (dummy != 0):
|
|
if (dummy != 0):
|
|
|
exit("Syntax error in TargetAdd "+target)
|
|
exit("Syntax error in TargetAdd "+target)
|
|
|
if ipath is None: ipath = opts
|
|
if ipath is None: ipath = opts
|
|
@@ -3351,11 +3446,10 @@ def TargetAdd(target, dummy=0, opts=[], input=[], dep=[], ipath=None, winrc=None
|
|
|
if (type(input) == str): input = [input]
|
|
if (type(input) == str): input = [input]
|
|
|
if (type(dep) == str): dep = [dep]
|
|
if (type(dep) == str): dep = [dep]
|
|
|
|
|
|
|
|
- if os.path.splitext(target)[1] == '.pyd' and PkgSkip("PYTHON"):
|
|
|
|
|
- # It makes no sense to build Python modules with python disabled.
|
|
|
|
|
- return
|
|
|
|
|
|
|
+ if target.endswith(".pyd") and not pyabi:
|
|
|
|
|
+ raise RuntimeError("Use PyTargetAdd to build .pyd targets")
|
|
|
|
|
|
|
|
- full = FindLocation(target, [OUTPUTDIR + "/include"])
|
|
|
|
|
|
|
+ full = FindLocation(target, [OUTPUTDIR + "/include"], pyabi=pyabi)
|
|
|
|
|
|
|
|
if (full not in TARGET_TABLE):
|
|
if (full not in TARGET_TABLE):
|
|
|
t = Target()
|
|
t = Target()
|
|
@@ -3374,7 +3468,7 @@ def TargetAdd(target, dummy=0, opts=[], input=[], dep=[], ipath=None, winrc=None
|
|
|
|
|
|
|
|
ipath = [OUTPUTDIR + "/tmp"] + GetListOption(ipath, "DIR:") + [OUTPUTDIR+"/include"]
|
|
ipath = [OUTPUTDIR + "/tmp"] + GetListOption(ipath, "DIR:") + [OUTPUTDIR+"/include"]
|
|
|
for x in input:
|
|
for x in input:
|
|
|
- fullinput = FindLocation(x, ipath)
|
|
|
|
|
|
|
+ fullinput = FindLocation(x, ipath, pyabi=pyabi)
|
|
|
t.inputs.append(fullinput)
|
|
t.inputs.append(fullinput)
|
|
|
# Don't re-link a library or binary if just its dependency dlls have been altered.
|
|
# Don't re-link a library or binary if just its dependency dlls have been altered.
|
|
|
# This should work out fine in most cases, and often reduces recompilation time.
|
|
# This should work out fine in most cases, and often reduces recompilation time.
|
|
@@ -3413,7 +3507,7 @@ def TargetAdd(target, dummy=0, opts=[], input=[], dep=[], ipath=None, winrc=None
|
|
|
t.deps[fulln] = 1
|
|
t.deps[fulln] = 1
|
|
|
|
|
|
|
|
for x in dep:
|
|
for x in dep:
|
|
|
- fulldep = FindLocation(x, ipath)
|
|
|
|
|
|
|
+ fulldep = FindLocation(x, ipath, pyabi=pyabi)
|
|
|
t.deps[fulldep] = 1
|
|
t.deps[fulldep] = 1
|
|
|
|
|
|
|
|
if winrc and GetTarget() == 'windows':
|
|
if winrc and GetTarget() == 'windows':
|
|
@@ -3430,3 +3524,32 @@ def TargetAdd(target, dummy=0, opts=[], input=[], dep=[], ipath=None, winrc=None
|
|
|
|
|
|
|
|
if target.endswith(".pz") and not CrossCompiling():
|
|
if target.endswith(".pz") and not CrossCompiling():
|
|
|
t.deps[FindLocation("pzip.exe", [])] = 1
|
|
t.deps[FindLocation("pzip.exe", [])] = 1
|
|
|
|
|
+
|
|
|
|
|
+ if target.endswith(".in"):
|
|
|
|
|
+ # Also add a target to compile the _igate.cxx file into an _igate.obj.
|
|
|
|
|
+ outbase = os.path.basename(target)[:-3]
|
|
|
|
|
+ woutc = OUTPUTDIR + "/tmp/" + outbase + "_igate.cxx"
|
|
|
|
|
+ CxxDependencyCache[woutc] = []
|
|
|
|
|
+ PyTargetAdd(outbase + "_igate.obj", opts=opts+['PYTHON','BIGOBJ'], input=woutc, dep=target)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+def PyTargetAdd(target, opts=[], **kwargs):
|
|
|
|
|
+ if PkgSkip("PYTHON"):
|
|
|
|
|
+ return
|
|
|
|
|
+
|
|
|
|
|
+ if 'PYTHON' not in opts:
|
|
|
|
|
+ opts = opts + ['PYTHON']
|
|
|
|
|
+
|
|
|
|
|
+ abi = GetPythonABI()
|
|
|
|
|
+
|
|
|
|
|
+ MakeDirectory(OUTPUTDIR + "/tmp/" + abi)
|
|
|
|
|
+
|
|
|
|
|
+ # Mark this target as being a Python-specific target.
|
|
|
|
|
+ orig = CalcLocation(target, [OUTPUTDIR + "/include"])
|
|
|
|
|
+ PYABI_SPECIFIC.add(orig)
|
|
|
|
|
+
|
|
|
|
|
+ if orig.startswith(OUTPUTDIR + "/tmp/") and os.path.exists(orig):
|
|
|
|
|
+ print("Removing file %s" % (orig))
|
|
|
|
|
+ os.unlink(orig)
|
|
|
|
|
+
|
|
|
|
|
+ TargetAdd(target, opts=opts, pyabi=abi, **kwargs)
|