|
From: <pat...@us...> - 2007-06-25 22:00:29
|
Revision: 593
http://svn.sourceforge.net/xml-cppdom/?rev=593&view=rev
Author: patrickh
Date: 2007-06-25 15:00:32 -0700 (Mon, 25 Jun 2007)
Log Message:
-----------
Clean up the debug/hybrid handling (at least in my view of "clean"). Instead
of checking for _DEBUG, check for CPPDOM_DEBUG and let the usage of _DEBUG
indicate whether the debug VC++ runtime is to be used. This removes the use
of the preprocessor symbol _USE_RELEASE_RUNTIME.
Modified Paths:
--------------
trunk/cppdom/SConscript
trunk/cppdom/config.h
trunk/test/SConscript
Modified: trunk/cppdom/SConscript
===================================================================
--- trunk/cppdom/SConscript 2007-06-25 21:58:54 UTC (rev 592)
+++ trunk/cppdom/SConscript 2007-06-25 22:00:32 UTC (rev 593)
@@ -30,6 +30,9 @@
cppdom_lib_env = build_env.Copy()
cppdom_lib_env.Append(CPPPATH = [inst_paths['include'],])
+if "debug" in combo["type"] or "hybrid" in combo["type"]:
+ cppdom_lib_env.AppendUnique(CPPDEFINES = ["CPPDOM_DEBUG"])
+
# If should not do static only, then create static and shared libraries
if "shared" in combo["libtype"]:
shlinkcom = cppdom_lib_env['SHLINKCOM']
Modified: trunk/cppdom/config.h
===================================================================
--- trunk/cppdom/config.h 2007-06-25 21:58:54 UTC (rev 592)
+++ trunk/cppdom/config.h 2007-06-25 22:00:32 UTC (rev 593)
@@ -83,8 +83,12 @@
CPPDOM_STRINGIZE(CPPDOM_VERSION_MINOR) "_" \
CPPDOM_STRINGIZE(CPPDOM_VERSION_PATCH)
-# if defined(_DEBUG) && !defined(_USE_RELEASE_RUNTIME)
-# define CPPDOM_LIB_RT_OPT "_d"
+# if defined(CPPDOM_DEBUG)
+# if defined(_DEBUG)
+# define CPPDOM_LIB_RT_OPT "_d"
+# else
+# define CPPDOM_LIB_RT_OPT "_h"
+# endif
# else
# define CPPDOM_LIB_RT_OPT ""
# endif
@@ -111,9 +115,5 @@
# define CPPDOM_CLASS
#endif
-#ifdef _DEBUG
-#define CPPDOM_DEBUG
-#endif
-
// -----------------------------------
#endif
Modified: trunk/test/SConscript
===================================================================
--- trunk/test/SConscript 2007-06-25 21:58:54 UTC (rev 592)
+++ trunk/test/SConscript 2007-06-25 22:00:32 UTC (rev 593)
@@ -9,15 +9,27 @@
LIBPATH = [inst_paths['lib'],],
LIBS = [cppdom_app_libname])
+# On Windows, we always use automatic linking.
+if GetPlatform() == "win32":
+ test_env.AppendUnique(CPPDEFINES = ["CPPDOM_AUTO_LINK"])
+
+ # Use dynamic linking if we are building against a DLL rather than a
+ # static library.
+ if "shared" in combo["libtype"]:
+ test_env.AppendUnique(CPPDEFINES = ["CPPDOM_DYN_LINK"])
+
+ # For a "hybrid" build (one that links against the release VC++ runtime
+ # and puts debug symbols in the compiled code) or a debug build, define
+ # CPPDOM_DEBUG.
+ if "hybrid" in combo["type"] or "debug" in combo["type"]:
+ test_env.AppendUnique(CPPDEFINES = ["CPPDOM_DEBUG"])
+
tests = Split("""
maketree
nodetest
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.
|