From 3012187847b2783c49153db3f5486b84074cb2b0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 28 Feb 2012 12:38:15 +0200 Subject: Build infrastructure for C++11 support --- odb/details/config-vc.h | 6 ++++++ odb/details/config.h.in | 2 ++ odb/details/config.hxx | 3 +++ odb/makefile | 11 +++++++++-- 4 files changed, 20 insertions(+), 2 deletions(-) (limited to 'odb') diff --git a/odb/details/config-vc.h b/odb/details/config-vc.h index 4ab9a7e..6b1da9e 100644 --- a/odb/details/config-vc.h +++ b/odb/details/config-vc.h @@ -11,4 +11,10 @@ #define ODB_THREADS_WIN32 #define ODB_THREADS_TLS_DECLSPEC +/* VC++10 has C++11 always enabled. + */ +#if _MSC_VER >= 1600 +# define ODB_CXX11 +#endif + #endif /* ODB_DETAILS_CONFIG_VC_H */ diff --git a/odb/details/config.h.in b/odb/details/config.h.in index 2422d98..5e71765 100644 --- a/odb/details/config.h.in +++ b/odb/details/config.h.in @@ -14,6 +14,8 @@ #undef ODB_THREADS_TLS_KEYWORD #undef ODB_THREADS_TLS_DECLSPEC +#undef ODB_CXX11 + #undef LIBODB_STATIC_LIB #endif /* ODB_DETAILS_CONFIG_H */ diff --git a/odb/details/config.hxx b/odb/details/config.hxx index 1d7c2d9..ad0ec27 100644 --- a/odb/details/config.hxx +++ b/odb/details/config.hxx @@ -12,6 +12,9 @@ #elif defined(ODB_COMPILER) # define ODB_THREADS_NONE # define LIBODB_STATIC_LIB +# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L +# define ODB_CXX11 +# endif #else # include #endif diff --git a/odb/makefile b/odb/makefile index 7633e8f..26820d2 100644 --- a/odb/makefile +++ b/odb/makefile @@ -15,7 +15,6 @@ statement.cxx \ tracer.cxx \ transaction.cxx - # Implementation details. # cxx += \ @@ -69,7 +68,6 @@ default := $(out_base)/ dist := $(out_base)/.dist clean := $(out_base)/.clean - # Build. # $(odb.l): $(cxx_obj) @@ -81,6 +79,10 @@ endif $(cxx_obj) $(cxx_od): $(odb.l.cpp-options) $(out_base)/details/config.h $(odb.l.cpp-options): value := -I$(out_root) -I$(src_root) +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard + +ifdef libodb_threads +ifdef cxx_standard $(out_base)/details/config.h: | $(out_base)/details/. @echo '/* file : odb/details/config.h' >$@ @echo ' * note : automatically generated' >>$@ @@ -98,8 +100,13 @@ endif ifeq ($(libodb_threads),none) @echo '#define ODB_THREADS_NONE 1' >>$@ endif +ifeq ($(cxx_standard),c++11) + @echo '#define ODB_CXX11 1' >>$@ +endif @echo '' >>$@ @echo '#endif /* ODB_DETAILS_CONFIG_H */' >>$@ +endif +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(out_base)/details/config.h) -- cgit v1.1