@@ -48,8 +48,7 @@ if env['PLATFORM'] == 'darwin':
4848
4949# Compiler specific options
5050if env ['PLATFORM' ] == 'win32' :
51- # BUILD_DLL makes DLL_EXPORT export symbols, see diffpy/Export.hpp.
52- env .AppendUnique (CPPDEFINES = ['BUILD_DLL' , '_USE_MATH_DEFINES' ])
51+ env .AppendUnique (CPPDEFINES = ['_USE_MATH_DEFINES' ])
5352 if env ['tool' ] == 'clang' :
5453 # clang++ on Windows
5554 env ['CC' ] = 'clang'
@@ -63,7 +62,10 @@ if env['PLATFORM'] == 'win32':
6362 env .AppendUnique (LINKFLAGS = '-m64' )
6463 else :
6564 # Visual C++
66- env .PrependUnique (CCFLAGS = ['/Ox' , '/EHsc' , '/MD' , '/Wall' ])
65+ # /W3 rather than /Wall, which floods the log with warnings from the
66+ # standard library and boost headers. /bigobj is needed for the
67+ # boost serialization code.
68+ env .PrependUnique (CCFLAGS = ['/Ox' , '/EHsc' , '/MD' , '/W3' , '/bigobj' ])
6769 env .AppendUnique (CXXFLAGS = '/std:c++latest' )
6870 env .AppendUnique (CPPDEFINES = {'NDEBUG' : None })
6971 env .AppendUnique (LINKFLAGS = ['/OPT:NOREF' , '/OPT:NOICF' ])
@@ -167,6 +169,10 @@ if 'sdist' in COMMAND_LINE_TARGETS:
167169
168170# use new environment with extra libraries needed for libdiffpy.
169171env_lib = env .Clone ()
172+ if env ['PLATFORM' ] == 'win32' :
173+ # Export the API from the DLL, see diffpy/Export.hpp. Code that uses
174+ # the library, including the unit tests, imports it instead.
175+ env_lib .AppendUnique (CPPDEFINES = ['BUILD_DLL' ])
170176# The dladdr call in runtimepath.cpp requires the dl library.
171177# Windows uses GetModuleHandleEx instead.
172178if env ['PLATFORM' ] != 'win32' :
0 commit comments