@@ -1515,7 +1515,9 @@ def CompileLib(lib, obj, opts):
1515
1515
if HasTargetArch ():
1516
1516
cmd += " /MACHINE:" + GetTargetArch ().upper ()
1517
1517
cmd += ' /OUT:' + BracketNameWithQuotes (lib )
1518
- for x in obj : cmd += ' ' + BracketNameWithQuotes (x )
1518
+ for x in obj :
1519
+ if not x .endswith ('.lib' ):
1520
+ cmd += ' ' + BracketNameWithQuotes (x )
1519
1521
oscmd (cmd )
1520
1522
else :
1521
1523
# Choose Intel linker; from Jean-Claude
@@ -1568,6 +1570,21 @@ def CompileLink(dll, obj, opts):
1568
1570
cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
1569
1571
cmd += ' /OUT:' + BracketNameWithQuotes (dll )
1570
1572
1573
+ if not PkgSkip ("PYTHON" ):
1574
+ # If we're building without Python, don't pick it up implicitly.
1575
+ if "PYTHON" not in opts :
1576
+ pythonv = SDK ["PYTHONVERSION" ].replace ('.' , '' )
1577
+ if optlevel <= 2 :
1578
+ cmd += ' /NOD:{}d.lib' .format (pythonv )
1579
+ else :
1580
+ cmd += ' /NOD:{}.lib' .format (pythonv )
1581
+
1582
+ # Yes, we know we are importing "locally defined symbols".
1583
+ for x in obj :
1584
+ if x .endswith ('libp3pystub.lib' ):
1585
+ cmd += ' /ignore:4049,4217'
1586
+ break
1587
+
1571
1588
# Set the subsystem. Specify that we want to target Windows XP.
1572
1589
subsystem = GetValueOption (opts , "SUBSYSTEM:" ) or "CONSOLE"
1573
1590
cmd += " /SUBSYSTEM:" + subsystem
@@ -2691,7 +2708,7 @@ def CreatePandaVersionFiles():
2691
2708
import os
2692
2709
2693
2710
bindir = os.path.join(os.path.dirname(__file__), '..', 'bin')
2694
- if os.path.isfile(os.path.join( bindir, 'libpanda.dll') ):
2711
+ if os.path.isdir( bindir):
2695
2712
if not os.environ.get('PATH'):
2696
2713
os.environ['PATH'] = bindir
2697
2714
else:
0 commit comments