From 8f18bd0018046bbcf5eae6d29946423e8b457a0a Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 14 Sep 2015 21:11:04 +0200 Subject: [PATCH] [DEV] update Build interface and remove wrapper on boost when no x11 --- binding_X11/etk/chrono.h | 1 - binding_X11/etk/condition_variable.h | 1 - binding_X11/etk/functional.h | 1 - binding_X11/etk/memory.h | 1 - binding_X11/etk/mutex.h | 2 -- binding_X11/etk/thread.h | 1 - binding_boost/etk/chrono.h | 7 ----- binding_boost/etk/condition_variable.h | 7 ----- binding_boost/etk/functional.h | 23 ---------------- binding_boost/etk/memory.h | 11 -------- binding_boost/etk/mutex.h | 8 ------ binding_boost/etk/thread.h | 7 ----- etk/Color.h | 2 +- etk/Hash.h | 10 +++---- etk/archive/Zip.cpp | 1 + etk/log.cpp | 5 ++-- etk/math/Vector2D.cpp | 1 + etk/math/Vector2D.h | 1 - etk/math/Vector3D.cpp | 1 + etk/math/Vector3D.h | 1 - etk/math/Vector4D.h | 1 - etk/os/FSNode.cpp | 1 + etk/os/FSNode.h | 6 ++-- etk/stdTools.h | 4 +-- etk/thread/tools.cpp | 2 +- etk/thread/tools.h | 2 +- etk/types.h | 16 ++--------- lutin_etk.py | 38 ++++++++++++++++---------- 28 files changed, 47 insertions(+), 115 deletions(-) delete mode 100644 binding_X11/etk/chrono.h delete mode 100644 binding_X11/etk/condition_variable.h delete mode 100644 binding_X11/etk/functional.h delete mode 100644 binding_X11/etk/memory.h delete mode 100644 binding_X11/etk/mutex.h delete mode 100644 binding_X11/etk/thread.h delete mode 100644 binding_boost/etk/chrono.h delete mode 100644 binding_boost/etk/condition_variable.h delete mode 100644 binding_boost/etk/functional.h delete mode 100644 binding_boost/etk/memory.h delete mode 100644 binding_boost/etk/mutex.h delete mode 100644 binding_boost/etk/thread.h diff --git a/binding_X11/etk/chrono.h b/binding_X11/etk/chrono.h deleted file mode 100644 index 7f0623d..0000000 --- a/binding_X11/etk/chrono.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/binding_X11/etk/condition_variable.h b/binding_X11/etk/condition_variable.h deleted file mode 100644 index acce0c3..0000000 --- a/binding_X11/etk/condition_variable.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/binding_X11/etk/functional.h b/binding_X11/etk/functional.h deleted file mode 100644 index 9170481..0000000 --- a/binding_X11/etk/functional.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/binding_X11/etk/memory.h b/binding_X11/etk/memory.h deleted file mode 100644 index ef00360..0000000 --- a/binding_X11/etk/memory.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/binding_X11/etk/mutex.h b/binding_X11/etk/mutex.h deleted file mode 100644 index a55cb09..0000000 --- a/binding_X11/etk/mutex.h +++ /dev/null @@ -1,2 +0,0 @@ - -#include diff --git a/binding_X11/etk/thread.h b/binding_X11/etk/thread.h deleted file mode 100644 index ad3f06b..0000000 --- a/binding_X11/etk/thread.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/binding_boost/etk/chrono.h b/binding_boost/etk/chrono.h deleted file mode 100644 index 1e119b1..0000000 --- a/binding_boost/etk/chrono.h +++ /dev/null @@ -1,7 +0,0 @@ - -#ifndef __ETK_CHRONO_FROM_BOOST_H__ -#define __ETK_CHRONO_FROM_BOOST_H__ - -#include - -#endif diff --git a/binding_boost/etk/condition_variable.h b/binding_boost/etk/condition_variable.h deleted file mode 100644 index 49088bf..0000000 --- a/binding_boost/etk/condition_variable.h +++ /dev/null @@ -1,7 +0,0 @@ - -#ifndef __ETK_CONDITION_VARIABLE_FROM_BOOST_H__ -#define __ETK_CONDITION_VARIABLE_FROM_BOOST_H__ - -#include - -#endif diff --git a/binding_boost/etk/functional.h b/binding_boost/etk/functional.h deleted file mode 100644 index c7fd873..0000000 --- a/binding_boost/etk/functional.h +++ /dev/null @@ -1,23 +0,0 @@ - -#ifndef __ETK_FUNCTIONNAL_FROM_BOOST_H__ -#define __ETK_FUNCTIONNAL_FROM_BOOST_H__ - -#include -#include -#include - -namespace boost { - namespace placeholders { - static boost::arg<1> _1; - static boost::arg<2> _2; - static boost::arg<3> _3; - static boost::arg<4> _4; - static boost::arg<5> _5; - static boost::arg<6> _6; - static boost::arg<7> _7; - static boost::arg<8> _8; - static boost::arg<9> _9; - } -} - -#endif diff --git a/binding_boost/etk/memory.h b/binding_boost/etk/memory.h deleted file mode 100644 index 42837f2..0000000 --- a/binding_boost/etk/memory.h +++ /dev/null @@ -1,11 +0,0 @@ - -#ifndef __ETK_MEMORY_FROM_BOOST_H__ -#define __ETK_MEMORY_FROM_BOOST_H__ - -#include -#include -#include -#include - - -#endif diff --git a/binding_boost/etk/mutex.h b/binding_boost/etk/mutex.h deleted file mode 100644 index aead315..0000000 --- a/binding_boost/etk/mutex.h +++ /dev/null @@ -1,8 +0,0 @@ - -#ifndef __ETK_MUTEX_FROM_BOOST_H__ -#define __ETK_MUTEX_FROM_BOOST_H__ - -#include -#include - -#endif diff --git a/binding_boost/etk/thread.h b/binding_boost/etk/thread.h deleted file mode 100644 index d306e3e..0000000 --- a/binding_boost/etk/thread.h +++ /dev/null @@ -1,7 +0,0 @@ - -#ifndef __ETK_THREAD_FROM_BOOST_H__ -#define __ETK_THREAD_FROM_BOOST_H__ - -#include - -#endif diff --git a/etk/Color.h b/etk/Color.h index 850cd3d..844246b 100644 --- a/etk/Color.h +++ b/etk/Color.h @@ -300,7 +300,7 @@ namespace etk { } template Color::Color(const std::string& _input) { - TK_VERBOSE("convert color string : '" << _input << "'"); + //TK_VERBOSE("convert color string : '" << _input << "'"); const char* inputData = _input.c_str(); size_t len = _input.size(); if( len >=1 diff --git a/etk/Hash.h b/etk/Hash.h index cee7b88..002f2e7 100644 --- a/etk/Hash.h +++ b/etk/Hash.h @@ -134,7 +134,7 @@ namespace etk { static MY_TYPE g_error; int64_t elementId = getId(_key); if (elementId<0) { - TK_ERROR("try to acces at an unexistant hash element : " << _key); + //TK_ERROR("try to acces at an unexistant hash element : " << _key); return g_error; } return m_data[elementId]->m_value; @@ -162,7 +162,7 @@ namespace etk { if (elementId <0) { HashData* tmp = new HashData(_key, _value); if (NULL == tmp) { - TK_ERROR("allocation error in Hash table : '" << _key << "'"); + //TK_ERROR("allocation error in Hash table : '" << _key << "'"); return; } m_data.push_back(tmp); @@ -221,7 +221,7 @@ namespace etk { // NOTE :Do not change log level, this generate error only in debug mode #if DEBUG_LEVEL > 2 if(_pos>m_data.size()){ - TK_CRITICAL("Access to an unexistant data in hach : " << _pos << "/ " << m_data.size()); + //TK_CRITICAL("Access to an unexistant data in hach : " << _pos << "/ " << m_data.size()); } #endif return m_data[_pos]->m_key; @@ -248,7 +248,7 @@ namespace etk { // NOTE :Do not change log level, this generate error only in debug mode #if DEBUG_LEVEL > 2 if(_pos>m_data.size()){ - TK_CRITICAL("Access to an unexistant data in hach : " << _pos << "/ " << m_data.size()); + //TK_CRITICAL("Access to an unexistant data in hach : " << _pos << "/ " << m_data.size()); } #endif return m_data[_pos]->m_value; @@ -260,7 +260,7 @@ namespace etk { // NOTE :Do not change log level, this generate error only in debug mode #if DEBUG_LEVEL > 2 if(_pos>m_data.size()){ - TK_CRITICAL("Access to an unexistant data in hach : " << _pos << "/ " << m_data.size()); + //TK_CRITICAL("Access to an unexistant data in hach : " << _pos << "/ " << m_data.size()); } #endif return m_data[_pos]->m_value; diff --git a/etk/archive/Zip.cpp b/etk/archive/Zip.cpp index cdbd2b4..56df391 100644 --- a/etk/archive/Zip.cpp +++ b/etk/archive/Zip.cpp @@ -10,6 +10,7 @@ #include #include +#include etk::archive::Zip::Zip(const std::string& _fileName, uint64_t _offset) : etk::Archive(_fileName), diff --git a/etk/log.cpp b/etk/log.cpp index a508fba..8a3d7fd 100644 --- a/etk/log.cpp +++ b/etk/log.cpp @@ -8,11 +8,12 @@ #include #include -#include -#include +#include +#include #include #include #include +#include #if defined(__TARGET_OS__Android) # include diff --git a/etk/math/Vector2D.cpp b/etk/math/Vector2D.cpp index 406b6dc..681dafd 100644 --- a/etk/math/Vector2D.cpp +++ b/etk/math/Vector2D.cpp @@ -8,6 +8,7 @@ #include #include +#include std::ostream& etk::operator <<(std::ostream& _os, const etk::Vector2D& _obj) { _os << "("; diff --git a/etk/math/Vector2D.h b/etk/math/Vector2D.h index e4785f3..f66d2c5 100644 --- a/etk/math/Vector2D.h +++ b/etk/math/Vector2D.h @@ -12,7 +12,6 @@ #ifndef __ETK_MATH_VECTOR2D_H__ #define __ETK_MATH_VECTOR2D_H__ -#include #include namespace etk { diff --git a/etk/math/Vector3D.cpp b/etk/math/Vector3D.cpp index ee7bf8a..2182c2a 100644 --- a/etk/math/Vector3D.cpp +++ b/etk/math/Vector3D.cpp @@ -8,6 +8,7 @@ #include #include +#include std::ostream& etk::operator <<(std::ostream& _os, const ivec3& _obj) { _os << "("; diff --git a/etk/math/Vector3D.h b/etk/math/Vector3D.h index 8f7936d..a9ed136 100644 --- a/etk/math/Vector3D.h +++ b/etk/math/Vector3D.h @@ -11,7 +11,6 @@ #ifndef __ETK_MATH_VECTOR3D_H__ #define __ETK_MATH_VECTOR3D_H__ -#include #include #ifdef ETK_BUILD_LINEARMATH diff --git a/etk/math/Vector4D.h b/etk/math/Vector4D.h index a841e2f..17f4215 100644 --- a/etk/math/Vector4D.h +++ b/etk/math/Vector4D.h @@ -11,7 +11,6 @@ #ifndef __ETK_MATH_VECTOR4D_H__ #define __ETK_MATH_VECTOR4D_H__ -#include #include #ifdef ETK_BUILD_LINEARMATH #include diff --git a/etk/os/FSNode.cpp b/etk/os/FSNode.cpp index cf4200c..42d3e35 100644 --- a/etk/os/FSNode.cpp +++ b/etk/os/FSNode.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #ifdef __TARGET_OS__Windows diff --git a/etk/os/FSNode.h b/etk/os/FSNode.h index 32108ac..5515b0d 100644 --- a/etk/os/FSNode.h +++ b/etk/os/FSNode.h @@ -822,13 +822,13 @@ namespace etk { std::vector out; etk::FSNode node(_path); if (node.fileOpenRead() == false) { - TK_ERROR("can not open file : '" << node << "'"); + //TK_ERROR("can not open file : '" << node << "'"); return out; } uint64_t nbByte = node.fileSize(); out.resize(nbByte/sizeof(TTT)); if (out.size()*sizeof(TTT) != nbByte) { - TK_WARNING("Error in reading the file missing some byte at the end ..."); + //TK_WARNING("Error in reading the file missing some byte at the end ..."); } node.fileRead(&out[0], sizeof(TTT), nbByte/sizeof(TTT)); node.fileClose(); @@ -842,7 +842,7 @@ namespace etk { template void FSNodeWriteAllDataType(const std::string& _path, const std::vector& _data) { etk::FSNode node(_path); if (node.fileOpenWrite() == false) { - TK_ERROR("can not open file : '" << node << "'"); + //TK_ERROR("can not open file : '" << node << "'"); return; } node.fileWrite(&_data[0], sizeof(TTT), _data.size()); diff --git a/etk/stdTools.h b/etk/stdTools.h index 8abbf9d..e3b3486 100644 --- a/etk/stdTools.h +++ b/etk/stdTools.h @@ -9,14 +9,14 @@ #ifndef __ETK_STD_TOOLS_H__ #define __ETK_STD_TOOLS_H__ -#include +#include #include #include #include #include #include #include -#include +#include namespace u32char { extern const char32_t Null; //!< '\0' diff --git a/etk/thread/tools.cpp b/etk/thread/tools.cpp index 8f3d123..9a71faa 100644 --- a/etk/thread/tools.cpp +++ b/etk/thread/tools.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include static std11::mutex g_lock; diff --git a/etk/thread/tools.h b/etk/thread/tools.h index bb85bf2..4ddd307 100644 --- a/etk/thread/tools.h +++ b/etk/thread/tools.h @@ -11,7 +11,7 @@ #ifndef __ETK_THREAD_TOOLS_H__ #define __ETK_THREAD_TOOLS_H__ -#include +#include namespace etk { namespace thread { diff --git a/etk/types.h b/etk/types.h index 8027654..19239a5 100644 --- a/etk/types.h +++ b/etk/types.h @@ -43,19 +43,9 @@ #endif #endif - - -#if __CPP_VERSION__ < 2011 - #define nullptr NULL - typedef uint32_t char32_t; - namespace boost { - // just define - } - namespace std11 = boost; -#else - namespace std11 = std; -#endif - +namespace std17 = std; +namespace std14 = std; +namespace std11 = std; #include diff --git a/lutin_etk.py b/lutin_etk.py index 83543ab..24df98e 100644 --- a/lutin_etk.py +++ b/lutin_etk.py @@ -33,6 +33,25 @@ def create(target): if target.name=="IOs": myModule.add_src_file('etk/logIOs.m') + myModule.add_header_file([ + 'etk/etk.h', + 'etk/types.h', + 'etk/stdTools.h', + 'etk/log.h', + 'etk/tool.h', + 'etk/Noise.h', + 'etk/Color.h', + 'etk/Hash.h', + 'etk/thread/tools.h', + 'etk/math/Matrix4.h', + 'etk/math/Vector2D.h', + 'etk/math/Vector3D.h', + 'etk/math/Vector4D.h', + 'etk/os/Fifo.h', + 'etk/os/FSNode.h', + 'etk/os/FSNodeRight.h', + 'etk/archive/Archive.h', + 'etk/archive/Zip.h']) if target.config["mode"] == "release": # TODO : The other way is to remove this ... @@ -45,19 +64,10 @@ def create(target): if target.name != "Windows": myModule.add_export_flag('link', "-ldl -rdynamic") - # for ald C++ compatibility (old GCC) just link with boost ... - if target.config["compilator"] == "gcc" \ - and target.xx_version < 4007000: - # note : this framework depend on C++ 11, but a simple port of Boost for old compatibility has been done ... - myModule.compile_version_XX(1999) - myModule.add_optionnal_module_depend('boost', ["c++", "-DETK_BUILD_BOOST"], export=True) - myModule.add_export_path(tools.get_current_path(__file__) + "/binding_boost") - else: - myModule.compile_version_XX(2011) - # name of the dependency - myModule.add_optionnal_module_depend('minizip', ["c++", "-DETK_BUILD_MINIZIP"]) - myModule.add_optionnal_module_depend('linearmath', ["c", "-DETK_BUILD_LINEARMATH"], export=True) - myModule.add_export_path(tools.get_current_path(__file__) + "/binding_X11") + myModule.compile_version_XX(2011) + # name of the dependency + myModule.add_optionnal_module_depend('minizip', ["c++", "-DETK_BUILD_MINIZIP"]) + myModule.add_optionnal_module_depend('linearmath', ["c", "-DETK_BUILD_LINEARMATH"], export=True) if target.name=="Windows": pass @@ -66,7 +76,7 @@ def create(target): else: myModule.add_export_flag('link', "-lpthread") - myModule.add_export_path(tools.get_current_path(__file__)) + myModule.add_path(tools.get_current_path(__file__)) # add the currrent module at the return myModule