diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2024-04-29 13:17:26 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2024-04-29 13:17:26 +0200 |
commit | b62164b756ba79b92bef4082e2f988e72c9cc525 (patch) | |
tree | 0fefc8fb4ea404a6b72f4fac38102c541eea7645 /libodb | |
parent | b474ec02f806b7a7bcd9efa6f2198f0e314db75e (diff) |
Get rid of dual config support and _BUILD2 macro in runtime librariesmulti-package-version
Diffstat (limited to 'libodb')
-rw-r--r-- | libodb/odb/buildfile | 24 | ||||
-rw-r--r-- | libodb/odb/details/build2/config-stub.h | 5 | ||||
-rw-r--r-- | libodb/odb/details/build2/config-vc-stub.h | 5 | ||||
-rw-r--r-- | libodb/odb/details/build2/config-vc.h | 23 | ||||
-rw-r--r-- | libodb/odb/details/build2/config.h | 19 | ||||
-rw-r--r-- | libodb/odb/details/config-vc.h | 16 | ||||
-rw-r--r-- | libodb/odb/details/config.h | 18 | ||||
-rw-r--r-- | libodb/odb/details/config.h.in | 18 | ||||
-rw-r--r-- | libodb/odb/details/config.hxx | 8 | ||||
-rw-r--r-- | libodb/odb/details/export.hxx | 34 | ||||
-rw-r--r-- | libodb/odb/details/win32/dll.cxx | 7 |
11 files changed, 43 insertions, 134 deletions
diff --git a/libodb/odb/buildfile b/libodb/odb/buildfile index 2df1874..903893f 100644 --- a/libodb/odb/buildfile +++ b/libodb/odb/buildfile @@ -5,7 +5,7 @@ lib{odb}: {hxx ixx txx cxx}{* -version} \ {hxx}{version} \ details/{hxx ixx txx}{*} \ details/{cxx}{* -condition -lock -mutex} \ - details/build2/{h}{*} \ + details/{h}{*} \ details/meta/{hxx}{*} \ details/shared-ptr/{hxx ixx txx cxx}{*} \ details/win32/{hxx}{windows} @@ -23,14 +23,14 @@ hxx{version}: # Build options. # -cxx.poptions =+ "-I$out_root" "-I$src_root" -DLIBODB_BUILD2 +cxx.poptions =+ "-I$out_root" "-I$src_root" obja{*}: cxx.poptions += -DLIBODB_STATIC_BUILD objs{*}: cxx.poptions += -DLIBODB_SHARED_BUILD # Export options. # -lib{odb}: cxx.export.poptions = "-I$out_root" "-I$src_root" -DLIBODB_BUILD2 +lib{odb}: cxx.export.poptions = "-I$out_root" "-I$src_root" liba{odb}: cxx.export.poptions += -DLIBODB_STATIC libs{odb}: cxx.export.poptions += -DLIBODB_SHARED @@ -49,7 +49,7 @@ else # install_include = [dir_path] include/odb/ -{hxx ixx txx}{*}: +{h hxx ixx txx}{*}: { install = $install_include install.subdirs = true @@ -58,18 +58,10 @@ install_include = [dir_path] include/odb/ if ($cxx.target.class != "windows") details/win32/*: install = false -details/build2/ +details/ { - h{*}: install = false - - if ($cxx.target.system == 'win32-msvc') - { - h{config-vc}@./: install = $install_include/details/ - h{config-vc-stub}@./: install = $install_include/details/build2/config-vc.h - } + if ($cxx.target.system != 'win32-msvc') + h{config-vc}@./: install = false else - { - h{config}@./: install = $install_include/details/ - h{config-stub}@./: install = $install_include/details/build2/config.h - } + h{config}@./: install = false } diff --git a/libodb/odb/details/build2/config-stub.h b/libodb/odb/details/build2/config-stub.h deleted file mode 100644 index 83ea927..0000000 --- a/libodb/odb/details/build2/config-stub.h +++ /dev/null @@ -1,5 +0,0 @@ -/* file : odb/details/build2/config-stub.h - * license : GNU GPL v2; see accompanying LICENSE file - */ - -#include <odb/details/config.h> diff --git a/libodb/odb/details/build2/config-vc-stub.h b/libodb/odb/details/build2/config-vc-stub.h deleted file mode 100644 index e440e70..0000000 --- a/libodb/odb/details/build2/config-vc-stub.h +++ /dev/null @@ -1,5 +0,0 @@ -/* file : odb/details/build2/config-vc-stub.h - * license : GNU GPL v2; see accompanying LICENSE file - */ - -#include <odb/details/config-vc.h> diff --git a/libodb/odb/details/build2/config-vc.h b/libodb/odb/details/build2/config-vc.h deleted file mode 100644 index 77ce106..0000000 --- a/libodb/odb/details/build2/config-vc.h +++ /dev/null @@ -1,23 +0,0 @@ -/* file : odb/details/build2/config-vc.h - * license : GNU GPL v2; see accompanying LICENSE file - */ - -/* Configuration file for Windows/VC++ for the build2 build. */ - -#ifndef ODB_DETAILS_CONFIG_VC_H -#define ODB_DETAILS_CONFIG_VC_H - -/* Define LIBODB_BUILD2 for the installed case. */ -#ifndef LIBODB_BUILD2 -# define LIBODB_BUILD2 -#endif - -#ifndef ODB_THREADS_NONE -# if _MSC_VER >= 1900 -# define ODB_THREADS_CXX11 -# else -# error Unsupoprted MSVC version (no thread_local) -# endif -#endif - -#endif /* ODB_DETAILS_CONFIG_VC_H */ diff --git a/libodb/odb/details/build2/config.h b/libodb/odb/details/build2/config.h deleted file mode 100644 index ba434f4..0000000 --- a/libodb/odb/details/build2/config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* file : odb/details/build2/config.h - * license : GNU GPL v2; see accompanying LICENSE file - */ - -/* Static configuration file for the build2 build. */ - -#ifndef ODB_DETAILS_CONFIG_H -#define ODB_DETAILS_CONFIG_H - -/* Define LIBODB_BUILD2 for the installed case. */ -#ifndef LIBODB_BUILD2 -# define LIBODB_BUILD2 -#endif - -#ifndef ODB_THREADS_NONE -# define ODB_THREADS_CXX11 -#endif - -#endif /* ODB_DETAILS_CONFIG_H */ diff --git a/libodb/odb/details/config-vc.h b/libodb/odb/details/config-vc.h index b1e38b2..7c4def0 100644 --- a/libodb/odb/details/config-vc.h +++ b/libodb/odb/details/config-vc.h @@ -2,12 +2,22 @@ * license : GNU GPL v2; see accompanying LICENSE file */ -/* Configuration file for Windows/VC++. */ +/* Configuration file for Windows/VC++ for the build2 build. + * + * Note that currently we only support ODB_THREADS_NONE and ODB_THREADS_CXX11 + * but could also support the _WIN32 variant with a bit of effort. + * + */ #ifndef ODB_DETAILS_CONFIG_VC_H #define ODB_DETAILS_CONFIG_VC_H -#define ODB_THREADS_WIN32 -#define ODB_THREADS_TLS_DECLSPEC +#ifndef ODB_THREADS_NONE +# if _MSC_VER >= 1900 +# define ODB_THREADS_CXX11 +# else +# error Unsupoprted MSVC version (no thread_local) +# endif +#endif #endif /* ODB_DETAILS_CONFIG_VC_H */ diff --git a/libodb/odb/details/config.h b/libodb/odb/details/config.h new file mode 100644 index 0000000..4ad9a8d --- /dev/null +++ b/libodb/odb/details/config.h @@ -0,0 +1,18 @@ +/* file : odb/details/config.h + * license : GNU GPL v2; see accompanying LICENSE file + */ + +/* Static configuration file for build2 build. + * + * Note that currently we only support ODB_THREADS_NONE and ODB_THREADS_CXX11 + * but could also support the _POSIX and _WIN32 variants with a bit of effort. + */ + +#ifndef ODB_DETAILS_CONFIG_H +#define ODB_DETAILS_CONFIG_H + +#ifndef ODB_THREADS_NONE +# define ODB_THREADS_CXX11 +#endif + +#endif /* ODB_DETAILS_CONFIG_H */ diff --git a/libodb/odb/details/config.h.in b/libodb/odb/details/config.h.in deleted file mode 100644 index 2396606..0000000 --- a/libodb/odb/details/config.h.in +++ /dev/null @@ -1,18 +0,0 @@ -/* file : odb/details/config.h.in - * license : GNU GPL v2; see accompanying LICENSE file - */ - -/* This file is automatically processed by configure. */ - -#ifndef ODB_DETAILS_CONFIG_H -#define ODB_DETAILS_CONFIG_H - -#undef ODB_THREADS_NONE -#undef ODB_THREADS_POSIX -#undef ODB_THREADS_WIN32 -#undef ODB_THREADS_TLS_KEYWORD -#undef ODB_THREADS_TLS_DECLSPEC - -#undef LIBODB_STATIC_LIB - -#endif /* ODB_DETAILS_CONFIG_H */ diff --git a/libodb/odb/details/config.hxx b/libodb/odb/details/config.hxx index a42dd69..3168109 100644 --- a/libodb/odb/details/config.hxx +++ b/libodb/odb/details/config.hxx @@ -62,13 +62,7 @@ // #ifdef ODB_COMPILER # define ODB_THREADS_NONE -# define LIBODB_STATIC_LIB -#elif defined(LIBODB_BUILD2) -# if defined(_MSC_VER) -# include <odb/details/build2/config-vc.h> -# else -# include <odb/details/build2/config.h> -# endif +# define LIBODB_STATIC #elif defined(_MSC_VER) # include <odb/details/config-vc.h> #else diff --git a/libodb/odb/details/export.hxx b/libodb/odb/details/export.hxx index 80fe342..2ddc104 100644 --- a/libodb/odb/details/export.hxx +++ b/libodb/odb/details/export.hxx @@ -6,7 +6,7 @@ #include <odb/pre.hxx> -#include <odb/details/config.hxx> +#include <odb/details/config.hxx> // LIBODB_STATIC if ODB_COMPILER // Normally we don't export class templates (but do complete specializations), // inline functions, and classes with only inline member functions. Exporting @@ -16,8 +16,6 @@ // used before their inline definition. The workaround is to reorder code. In // the end it's all trial and error. -#ifdef LIBODB_BUILD2 - #if defined(LIBODB_STATIC) // Using static. # define LIBODB_EXPORT #elif defined(LIBODB_STATIC_BUILD) // Building static. @@ -43,36 +41,6 @@ # define LIBODB_EXPORT // Using static or shared. #endif -#else // LIBODB_BUILD2 - -#ifdef LIBODB_STATIC_LIB -# define LIBODB_EXPORT -#else -# ifdef _WIN32 -# ifdef _MSC_VER -# ifdef LIBODB_DYNAMIC_LIB -# define LIBODB_EXPORT __declspec(dllexport) -# else -# define LIBODB_EXPORT __declspec(dllimport) -# endif -# else -# ifdef LIBODB_DYNAMIC_LIB -# ifdef DLL_EXPORT -# define LIBODB_EXPORT __declspec(dllexport) -# else -# define LIBODB_EXPORT -# endif -# else -# define LIBODB_EXPORT __declspec(dllimport) -# endif -# endif -# else -# define LIBODB_EXPORT -# endif -#endif - -#endif // LIBODB_BUILD2 - #include <odb/post.hxx> #endif // ODB_DETAILS_EXPORT_HXX diff --git a/libodb/odb/details/win32/dll.cxx b/libodb/odb/details/win32/dll.cxx index 49b660c..3f674ba 100644 --- a/libodb/odb/details/win32/dll.cxx +++ b/libodb/odb/details/win32/dll.cxx @@ -1,12 +1,9 @@ // file : odb/details/win32/dll.cxx // license : GNU GPL v2; see accompanying LICENSE file -// If we are building a static library from VC++ (LIBODB_STATIC_LIB) or -// a static library from automake (!DLL_EXPORT), then omit DllMain. -// +// If we are building a static library then omit DllMain. -#if (defined(_MSC_VER) && defined(LIBODB_DYNAMIC_LIB)) || \ - (!defined(_MSC_VER) && defined(DLL_EXPORT)) +#ifdef LIBODB_SHARED_BUILD #include <odb/details/win32/windows.hxx> #include <odb/details/win32/init.hxx> |