From: <pat...@us...> - 2007-06-25 21:10:29
|
Revision: 591 http://svn.sourceforge.net/xml-cppdom/?rev=591&view=rev Author: patrickh Date: 2007-06-25 14:10:29 -0700 (Mon, 25 Jun 2007) Log Message: ----------- Fixed static linking on Windows. Modified Paths: -------------- trunk/cppdom/SConscript trunk/cppdom/config.h trunk/test/SConscript Modified: trunk/cppdom/SConscript =================================================================== --- trunk/cppdom/SConscript 2007-06-25 16:51:06 UTC (rev 590) +++ trunk/cppdom/SConscript 2007-06-25 21:10:29 UTC (rev 591) @@ -28,8 +28,7 @@ sources.append("SpiritParser.cpp") cppdom_lib_env = build_env.Copy() -cppdom_lib_env.Append(CPPPATH = [inst_paths['include'],], - CPPDEFINES=["CPPDOM_EXPORTS",]) +cppdom_lib_env.Append(CPPPATH = [inst_paths['include'],]) # If should not do static only, then create static and shared libraries if "shared" in combo["libtype"]: @@ -38,13 +37,16 @@ if cppdom_lib_env.has_key('MSVS_VERSION') and float(cppdom_lib_env['MSVS_VERSION']) >= 8.0: shlinkcom = [shlinkcom, 'mt.exe -manifest ${TARGET}.manifest -outputresource:$TARGET;2'] - cppdom_lib = cppdom_lib_env.SharedLibrary(cppdom_shared_libname, sources, - SHLINKCOM = shlinkcom) - cppdom_lib_env.Install(inst_paths['lib'], cppdom_lib) + cppdom_shared_lib_env = cppdom_lib_env.Copy() + cppdom_shared_lib_env.AppendUnique(CPPDEFINES = ["CPPDOM_EXPORTS", "CPPDOM_DYN_LINK"]) + cppdom_lib = cppdom_shared_lib_env.SharedLibrary(cppdom_shared_libname, sources, + SHLINKCOM = shlinkcom) + cppdom_shared_lib_env.Install(inst_paths['lib'], cppdom_lib) if "static" in combo["libtype"]: - cppdom_static_lib = cppdom_lib_env.StaticLibrary(cppdom_static_libname, sources) - cppdom_lib_env.Install(inst_paths['lib'], cppdom_static_lib) + cppdom_static_lib_env = cppdom_lib_env.Copy() + cppdom_static_lib = cppdom_static_lib_env.StaticLibrary(cppdom_static_libname, sources) + cppdom_static_lib_env.Install(inst_paths['lib'], cppdom_static_lib) if variant_pass == 0: header_path = pj(inst_paths['include'],'cppdom') Modified: trunk/cppdom/config.h =================================================================== --- trunk/cppdom/config.h 2007-06-25 16:51:06 UTC (rev 590) +++ trunk/cppdom/config.h 2007-06-25 21:10:29 UTC (rev 591) @@ -46,8 +46,9 @@ #define CPPDOM_CONFIG_H // ----------------------------------- -// win32 configuration -#if defined(WIN32) || defined(WIN64) +// win32 DLL configuration +#if (defined(WIN32) || defined(WIN64)) && \ + (defined(CPPDOM_AUTO_LINK) || defined(CPPDOM_DYN_LINK)) // switch some warnings off # pragma warning( disable: 4786 4275 4251 ) @@ -99,6 +100,7 @@ # endif /* defined(_MSC_VER) && (defined(CPPDOM_AUTO_LINK) || defined(CPPDOM_DYN_LINK)) */ # endif /* defined(CPPDOM_EXPORTS) */ +// UNIX handling and static linking on Windows. #else # define CPPDOM_EXPORT(ret) ret # define CPPDOM_CLASS Modified: trunk/test/SConscript =================================================================== --- trunk/test/SConscript 2007-06-25 16:51:06 UTC (rev 590) +++ trunk/test/SConscript 2007-06-25 21:10:29 UTC (rev 591) @@ -15,6 +15,9 @@ parsetest """) +if "shared" in combo["libtype"]: + test_env.AppendUnique(CPPDEFINES = ["CPPDOM_DYN_LINK"]) + for t in tests: test_prog = test_env.Program(t, t+'.cpp') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |