added workaround for Platform SDK's libcp.lib
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4325 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
0f7012e04e
commit
8507a9027d
1 changed files with 40 additions and 0 deletions
|
@ -19,6 +19,46 @@ if defenv['DEBUG']:
|
||||||
defenv.Append(CCFLAGS = '/Fd${TARGET.dir}\\${TARGET.dir.file}.pdb')
|
defenv.Append(CCFLAGS = '/Fd${TARGET.dir}\\${TARGET.dir.file}.pdb')
|
||||||
defenv.Append(LINKFLAGS = '/debug')
|
defenv.Append(LINKFLAGS = '/debug')
|
||||||
|
|
||||||
|
### workarounds
|
||||||
|
|
||||||
|
# latest Platform SDK includes a bad version of libcp.lib.
|
||||||
|
# if stl usage causes link failure, copy the good libcp.lib
|
||||||
|
# from one of the other lib folders and use it instead.
|
||||||
|
|
||||||
|
conf = defenv.Configure()
|
||||||
|
|
||||||
|
libcptest = """
|
||||||
|
#include <fstream>
|
||||||
|
int main() {
|
||||||
|
// %s
|
||||||
|
std::ofstream header("test", std::ofstream::out);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|
||||||
|
conf.env.PrependENVPath('LIB', Dir('#/.sconf_temp').abspath)
|
||||||
|
conf.env.Append(CCFLAGS = ['$EXCEPTION_FLAG'])
|
||||||
|
|
||||||
|
if not conf.TryLink(libcptest % 'no change', '.cpp'):
|
||||||
|
import os, shutil
|
||||||
|
|
||||||
|
libdirs = defenv['ENV']['LIB'].split(os.pathsep)
|
||||||
|
libdirs.remove(Dir('#/.sconf_temp').abspath);
|
||||||
|
|
||||||
|
for libdir in libdirs:
|
||||||
|
try:
|
||||||
|
libcp = r'%s\libcp.lib' % libdir
|
||||||
|
shutil.copy(libcp, Dir('#/.sconf_temp').abspath)
|
||||||
|
if conf.TryLink(libcptest % (r'using %s' % libcp), '.cpp'):
|
||||||
|
break
|
||||||
|
except IOError:
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
print "*** Couldn't find a good version of libcp.lib"
|
||||||
|
Exit(2)
|
||||||
|
|
||||||
|
conf.Finish()
|
||||||
|
|
||||||
### stub environment
|
### stub environment
|
||||||
|
|
||||||
stub_env = defenv.Copy()
|
stub_env = defenv.Copy()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue