Skip to content

Commit

Permalink
cleanup pch; move some macros to SConstruct
Browse files Browse the repository at this point in the history
  • Loading branch information
milkie committed Apr 3, 2012
1 parent 5d468c6 commit 51e9cc2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 25 deletions.
19 changes: 8 additions & 11 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,11 @@ if has_option( "libpath" ):
if has_option( "cpppath" ):
env["CPPPATH"] = [get_option( "cpppath" )]

env.Prepend( CPPDEFINES=[ "_SCONS" , "MONGO_EXPOSE_MACROS" ],
env.Prepend( CPPDEFINES=[ "_SCONS" ,
"MONGO_EXPOSE_MACROS" ,
"SUPPORT_UTF8" ], # for pcre


CPPPATH=[ '$BUILD_DIR', "$BUILD_DIR/mongo" ] )

if has_option( "safeshell" ):
Expand Down Expand Up @@ -534,8 +538,6 @@ elif "win32" == os.sys.platform:

env.Append( EXTRACPPPATH=[ winSDKHome + "/Include" ] )

# consider adding /MP build with multiple processes option.

# /EHsc exception handling style for visual studio
# /W3 warning level
# /WX abort build on compiler warnings
Expand Down Expand Up @@ -603,7 +605,6 @@ elif "win32" == os.sys.platform:
env.Append( EXTRALIBPATH=[ winSDKHome + "/Lib" ] )

if release:
#env.Append( LINKFLAGS=" /NODEFAULTLIB:MSVCPRT /NODEFAULTLIB:MSVCRTD " )
env.Append( LINKFLAGS=" /NODEFAULTLIB:MSVCPRT " )
else:
env.Append( LINKFLAGS=" /NODEFAULTLIB:MSVCPRT /NODEFAULTLIB:MSVCRT " )
Expand All @@ -613,7 +614,6 @@ elif "win32" == os.sys.platform:
if force64:

winLibString += ""
#winLibString += " LIBCMT LIBCPMT "

else:
winLibString += " user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib "
Expand All @@ -625,12 +625,6 @@ elif "win32" == os.sys.platform:

env.Append( LIBS=Split(winLibString) )

# dm these should automatically be defined by the compiler. commenting out to see if works. jun2010
#if force64:
# env.Append( CPPDEFINES=["_AMD64_=1"] )
#else:
# env.Append( CPPDEFINES=["_X86_=1"] )

env.Append( EXTRACPPPATH=["#/../winpcap/Include"] )
env.Append( EXTRALIBPATH=["#/../winpcap/Lib"] )

Expand Down Expand Up @@ -716,6 +710,9 @@ if usev8:
env.Prepend( EXTRACPPPATH=["#/../v8/include/"] )
env.Prepend( EXTRALIBPATH=["#/../v8/"] )

if usesm:
env.Append( CPPDEFINES=["JS_C_STRINGS_ARE_UTF8"] )

if "uname" in dir(os):
hacks = buildscripts.findHacks( os.uname() )
if hacks is not None:
Expand Down
14 changes: 0 additions & 14 deletions src/mongo/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,6 @@
#ifndef MONGO_PCH_H
#define MONGO_PCH_H

// MONGO_EXPOSE_MACROS is defined for internal mongo programs.
// C++ driver consumers do not define this.
#if defined(MONGO_EXPOSE_MACROS)

# define JS_C_STRINGS_ARE_UTF8
# undef SUPPORT_UCP
# define SUPPORT_UCP
# undef SUPPORT_UTF8
# define SUPPORT_UTF8
# undef _CRT_SECURE_NO_WARNINGS
# define _CRT_SECURE_NO_WARNINGS

#endif

// our #define macros must not be active when we include
// system headers and boost headers
#include "mongo/client/undef_macros.h"
Expand Down

0 comments on commit 51e9cc2

Please sign in to comment.