diff --git a/modules/database/SCsub b/modules/database/SCsub new file mode 100644 index 000000000..43dfe2365 --- /dev/null +++ b/modules/database/SCsub @@ -0,0 +1,23 @@ +import os +import version + +Import('env') + +module_env = env.Clone() + +sources = [ + "register_types.cpp", +] + +if ARGUMENTS.get('custom_modules_shared', 'no') == 'yes': + # Shared lib compilation + module_env.Append(CCFLAGS=['-fPIC']) + module_env['LIBS'] = [] + shared_lib = module_env.SharedLibrary(target='#bin/database', source=sources) + shared_lib_shim = shared_lib[0].name.rsplit('.', 1)[0] + env.Append(LIBS=[shared_lib_shim]) + env.Append(LIBPATH=['#bin']) +else: + # Static compilation + module_env.add_source_files(env.modules_sources, sources) + diff --git a/modules/database/config.py b/modules/database/config.py new file mode 100644 index 000000000..7ee6cced8 --- /dev/null +++ b/modules/database/config.py @@ -0,0 +1,17 @@ + +def can_build(env, platform): + return True + + +def configure(env): + pass + + +def get_doc_classes(): + return [ + #"", + ] + +def get_doc_path(): + return "doc_classes" + diff --git a/modules/database/database/database.cpp b/modules/database/database.cpp similarity index 100% rename from modules/database/database/database.cpp rename to modules/database/database.cpp diff --git a/modules/database/database/database.h b/modules/database/database.h similarity index 100% rename from modules/database/database/database.h rename to modules/database/database.h diff --git a/modules/database/database/SCsub b/modules/database/database/SCsub deleted file mode 100644 index de4f8efb2..000000000 --- a/modules/database/database/SCsub +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env python - -Import("env") - -env.core_sources = [] - -env.add_source_files(env.core_sources, "*.cpp") - -# Build it all as a library -lib = env.add_library("database", env.core_sources) -env.Prepend(LIBS=[lib]) diff --git a/modules/database/database/database_manager.cpp b/modules/database/database_manager.cpp similarity index 100% rename from modules/database/database/database_manager.cpp rename to modules/database/database_manager.cpp diff --git a/modules/database/database/database_manager.h b/modules/database/database_manager.h similarity index 100% rename from modules/database/database/database_manager.h rename to modules/database/database_manager.h diff --git a/modules/database/database/query_builder.cpp b/modules/database/query_builder.cpp similarity index 100% rename from modules/database/database/query_builder.cpp rename to modules/database/query_builder.cpp diff --git a/modules/database/database/query_builder.h b/modules/database/query_builder.h similarity index 100% rename from modules/database/database/query_builder.h rename to modules/database/query_builder.h diff --git a/modules/database/database/query_result.cpp b/modules/database/query_result.cpp similarity index 100% rename from modules/database/database/query_result.cpp rename to modules/database/query_result.cpp diff --git a/modules/database/database/query_result.h b/modules/database/query_result.h similarity index 100% rename from modules/database/database/query_result.h rename to modules/database/query_result.h diff --git a/modules/database/register_types.cpp b/modules/database/register_types.cpp new file mode 100644 index 000000000..76bbce18d --- /dev/null +++ b/modules/database/register_types.cpp @@ -0,0 +1,30 @@ +/* +Copyright (c) 2019-2022 Péter Magyar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include "register_types.h" + +void register_database_types() { + //ClassDB::register_class<>(); +} + +void unregister_database_types() { +} diff --git a/modules/database/register_types.h b/modules/database/register_types.h new file mode 100644 index 000000000..05e457553 --- /dev/null +++ b/modules/database/register_types.h @@ -0,0 +1,24 @@ +/* +Copyright (c) 2022 Péter Magyar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +void register_database_types(); +void unregister_database_types(); diff --git a/modules/database/database/table_builder.cpp b/modules/database/table_builder.cpp similarity index 100% rename from modules/database/database/table_builder.cpp rename to modules/database/table_builder.cpp diff --git a/modules/database/database/table_builder.h b/modules/database/table_builder.h similarity index 100% rename from modules/database/database/table_builder.h rename to modules/database/table_builder.h