mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2025-05-06 17:51:36 +02:00
Now the database backends will actually compile their .cpp files. Also small cleanups.
This commit is contained in:
parent
d713aeab8e
commit
4add0d14ea
@ -133,6 +133,7 @@ env_base.Append(CXX=["-o3"])
|
|||||||
#env_base.Append(CXX=["-g2"])
|
#env_base.Append(CXX=["-g2"])
|
||||||
|
|
||||||
env = env_base.Clone()
|
env = env_base.Clone()
|
||||||
|
Export("env")
|
||||||
|
|
||||||
for d in database_list:
|
for d in database_list:
|
||||||
tmppath = "./database/" + d
|
tmppath = "./database/" + d
|
||||||
@ -188,11 +189,9 @@ for m in module_list:
|
|||||||
sys.path.remove(tmppath)
|
sys.path.remove(tmppath)
|
||||||
sys.modules.pop("detect")
|
sys.modules.pop("detect")
|
||||||
|
|
||||||
Export("env")
|
|
||||||
|
|
||||||
SConscript("core/SCsub")
|
SConscript("core/SCsub")
|
||||||
|
|
||||||
env.prg_sources = ["rdn_application.cpp"]
|
env.prg_sources = [ "rdn_application.cpp" ]
|
||||||
libapp = env.add_library("application", env.prg_sources)
|
libapp = env.add_library("application", env.prg_sources)
|
||||||
env.Prepend(LIBS=[libapp])
|
env.Prepend(LIBS=[libapp])
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
Import("env_db")
|
Import("env_db")
|
||||||
|
Import("env")
|
||||||
|
|
||||||
env_db.core_sources = []
|
env_db.core_sources = []
|
||||||
|
|
||||||
@ -8,4 +9,4 @@ env_db.add_source_files(env_db.core_sources, "*.cpp")
|
|||||||
|
|
||||||
# Build it all as a library
|
# Build it all as a library
|
||||||
lib = env_db.add_library("database_mysql", env_db.core_sources)
|
lib = env_db.add_library("database_mysql", env_db.core_sources)
|
||||||
env_db.Prepend(LIBS=[lib])
|
env.Prepend(LIBS=[lib])
|
||||||
|
@ -1 +1,15 @@
|
|||||||
#include "mysql_database.h"
|
#include "mysql_database.h"
|
||||||
|
|
||||||
|
#include "core/database_manager.h"
|
||||||
|
|
||||||
|
Database *MysqlDatabase::_creation_func() {
|
||||||
|
return new MysqlDatabase();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MysqlDatabase::_register() {
|
||||||
|
DatabaseManager::_register_db_creation_func("mysql", MysqlDatabase::_creation_func);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MysqlDatabase::_unregister() {
|
||||||
|
DatabaseManager::_unregister_db_creation_func("mysql");
|
||||||
|
}
|
@ -2,7 +2,6 @@
|
|||||||
#define MYSQL_CONNECTION
|
#define MYSQL_CONNECTION
|
||||||
|
|
||||||
#include "core/database.h"
|
#include "core/database.h"
|
||||||
#include "core/database_manager.h"
|
|
||||||
|
|
||||||
//Brynet has it aswell, and because of using namespace it is defined here aswell
|
//Brynet has it aswell, and because of using namespace it is defined here aswell
|
||||||
//later this will be fixed better
|
//later this will be fixed better
|
||||||
@ -14,17 +13,9 @@
|
|||||||
|
|
||||||
class MysqlDatabase : public Database {
|
class MysqlDatabase : public Database {
|
||||||
public:
|
public:
|
||||||
static Database *_creation_func() {
|
static Database *_creation_func();
|
||||||
return new MysqlDatabase();
|
static void _register();
|
||||||
}
|
static void _unregister();
|
||||||
|
|
||||||
static void _register() {
|
|
||||||
DatabaseManager::_register_db_creation_func("mysql", MysqlDatabase::_creation_func);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void _unregister() {
|
|
||||||
DatabaseManager::_unregister_db_creation_func("mysql");
|
|
||||||
}
|
|
||||||
|
|
||||||
MysqlDatabase() : Database() {
|
MysqlDatabase() : Database() {
|
||||||
mysql = new MYSQL();
|
mysql = new MYSQL();
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
Import("env_db")
|
Import("env_db")
|
||||||
|
Import("env")
|
||||||
|
|
||||||
env_db.core_sources = []
|
env_db.core_sources = []
|
||||||
|
|
||||||
@ -8,4 +9,4 @@ env_db.add_source_files(env_db.core_sources, "*.cpp")
|
|||||||
|
|
||||||
# Build it all as a library
|
# Build it all as a library
|
||||||
lib = env_db.add_library("database_pgsql", env_db.core_sources)
|
lib = env_db.add_library("database_pgsql", env_db.core_sources)
|
||||||
env_db.Prepend(LIBS=[lib])
|
env.Prepend(LIBS=[lib])
|
||||||
|
@ -1 +1,15 @@
|
|||||||
#include "pgsql_database.h"
|
#include "pgsql_database.h"
|
||||||
|
|
||||||
|
#include "core/database_manager.h"
|
||||||
|
|
||||||
|
Database *PGSQLDatabase::_creation_func() {
|
||||||
|
return new PGSQLDatabase();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PGSQLDatabase::_register() {
|
||||||
|
DatabaseManager::_register_db_creation_func("pgsql", PGSQLDatabase::_creation_func);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PGSQLDatabase::_unregister() {
|
||||||
|
DatabaseManager::_unregister_db_creation_func("pgsql");
|
||||||
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
#define PGSQL_CONNECTION
|
#define PGSQL_CONNECTION
|
||||||
|
|
||||||
#include "core/database.h"
|
#include "core/database.h"
|
||||||
#include "core/database_manager.h"
|
|
||||||
|
|
||||||
//Brynet has it aswell, and because of using namespace it is defined here aswell
|
//Brynet has it aswell, and because of using namespace it is defined here aswell
|
||||||
//later this will be fixed better
|
//later this will be fixed better
|
||||||
@ -14,19 +13,12 @@
|
|||||||
|
|
||||||
class PGSQLDatabase : public Database {
|
class PGSQLDatabase : public Database {
|
||||||
public:
|
public:
|
||||||
static Database *_creation_func() {
|
static Database *_creation_func();
|
||||||
return new PGSQLDatabase();
|
static void _register();
|
||||||
}
|
static void _unregister();
|
||||||
|
|
||||||
static void _register() {
|
PGSQLDatabase() :
|
||||||
DatabaseManager::_register_db_creation_func("pgsql", PGSQLDatabase::_creation_func);
|
Database() {
|
||||||
}
|
|
||||||
|
|
||||||
static void _unregister() {
|
|
||||||
DatabaseManager::_unregister_db_creation_func("pgsql");
|
|
||||||
}
|
|
||||||
|
|
||||||
PGSQLDatabase() : Database() {
|
|
||||||
conn = PQconnectStart("");
|
conn = PQconnectStart("");
|
||||||
}
|
}
|
||||||
~PGSQLDatabase() {
|
~PGSQLDatabase() {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
Import("env_db")
|
Import("env_db")
|
||||||
|
Import("env")
|
||||||
|
|
||||||
env_db.core_sources = []
|
env_db.core_sources = []
|
||||||
|
|
||||||
@ -8,4 +9,4 @@ env_db.add_source_files(env_db.core_sources, "*.cpp")
|
|||||||
|
|
||||||
# Build it all as a library
|
# Build it all as a library
|
||||||
lib = env_db.add_library("database_pgsql", env_db.core_sources)
|
lib = env_db.add_library("database_pgsql", env_db.core_sources)
|
||||||
env_db.Prepend(LIBS=[lib])
|
env.Prepend(LIBS=[lib])
|
||||||
|
@ -1 +1,15 @@
|
|||||||
#include "sqlite3_database.h"
|
#include "sqlite3_database.h"
|
||||||
|
|
||||||
|
#include "core/database_manager.h"
|
||||||
|
|
||||||
|
Database *SQLite3Database::_creation_func() {
|
||||||
|
return new SQLite3Database();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SQLite3Database::_register() {
|
||||||
|
DatabaseManager::_register_db_creation_func("sqlite", SQLite3Database::_creation_func);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SQLite3Database::_unregister() {
|
||||||
|
DatabaseManager::_unregister_db_creation_func("sqlite");
|
||||||
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
#define SQLITE3_CONNECTION
|
#define SQLITE3_CONNECTION
|
||||||
|
|
||||||
#include "core/database.h"
|
#include "core/database.h"
|
||||||
#include "core/database_manager.h"
|
|
||||||
|
|
||||||
//Brynet has it aswell, and because of using namespace it is defined here aswell
|
//Brynet has it aswell, and because of using namespace it is defined here aswell
|
||||||
//later this will be fixed better
|
//later this will be fixed better
|
||||||
@ -16,17 +15,9 @@
|
|||||||
|
|
||||||
class SQLite3Database : public Database {
|
class SQLite3Database : public Database {
|
||||||
public:
|
public:
|
||||||
static Database *_creation_func() {
|
static Database *_creation_func();
|
||||||
return new SQLite3Database();
|
static void _register();
|
||||||
}
|
static void _unregister();
|
||||||
|
|
||||||
static void _register() {
|
|
||||||
DatabaseManager::_register_db_creation_func("sqlite", SQLite3Database::_creation_func);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void _unregister() {
|
|
||||||
DatabaseManager::_unregister_db_creation_func("sqlite");
|
|
||||||
}
|
|
||||||
|
|
||||||
SQLite3Database() :
|
SQLite3Database() :
|
||||||
Database() {
|
Database() {
|
||||||
|
Loading…
Reference in New Issue
Block a user