From 06a74ea172643240a76bac8f5eb5c6686ec19898 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 21 Dec 2024 16:13:48 +0800 Subject: [PATCH] f8 ok --- third_party/f8/f8/CMakeLists.txt | 33 ++++++++++++++++++++++++++++++++ third_party/f8/f8/app.cc | 1 + third_party/f8/f8/f8.h | 1 - third_party/f8/f8/timer.h | 22 --------------------- third_party/f8/f8/types.h | 23 ++++++++++++++++++++++ 5 files changed, 57 insertions(+), 23 deletions(-) create mode 100644 third_party/f8/f8/CMakeLists.txt diff --git a/third_party/f8/f8/CMakeLists.txt b/third_party/f8/f8/CMakeLists.txt new file mode 100644 index 0000000..4ee7883 --- /dev/null +++ b/third_party/f8/f8/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required (VERSION 3.8) +project(f8) + +if (${RELEASE}) + set(CMAKE_BUILD_TYPE "Release") + message("release mode") +else() + set(CMAKE_BUILD_TYPE "Debug") + message("debug mode") +endif() + +set(CMAKE_CXX_FLAGS_RELEASE "-Wall -g -std=c++17 ") +if (${ASAN}) + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=c++17 -DMYDEBUG -fsanitize=address -fno-omit-frame-pointer") +else() + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=c++17 -DMYDEBUG ") +endif() + +# include directories +include_directories( + AFTER + ../../a8 + ../../f8 + /usr/include/mysql + /usr/include/jsoncpp + /usr/include/glm +) + +aux_source_directory(. + SRC_LIST +) + +add_library(f8 STATIC ${SRC_LIST}) diff --git a/third_party/f8/f8/app.cc b/third_party/f8/f8/app.cc index dcd4809..1d5d567 100644 --- a/third_party/f8/f8/app.cc +++ b/third_party/f8/f8/app.cc @@ -16,6 +16,7 @@ #include #include #include +#include static const int MAX_ZONE_ID = 100; static const int MAX_NODE_ID = 8; diff --git a/third_party/f8/f8/f8.h b/third_party/f8/f8/f8.h index 92fa3cc..0eb2208 100644 --- a/third_party/f8/f8/f8.h +++ b/third_party/f8/f8/f8.h @@ -2,4 +2,3 @@ #include #include -#include diff --git a/third_party/f8/f8/timer.h b/third_party/f8/f8/timer.h index 6057920..b0d3017 100644 --- a/third_party/f8/f8/timer.h +++ b/third_party/f8/f8/timer.h @@ -2,28 +2,6 @@ namespace f8 { - class TimerWp - { - public: - TimerWp(a8::XTimerWp wp): real_obj_(wp) {}; - TimerWp() {}; - bool expired() { return real_obj_.expired();}; - - private: - a8::XTimerWp real_obj_; - friend class Timer; - }; - - class Attacher - { - public: - Attacher(); - void ClearTimerList(); - - private: - a8::Attacher real_obj_; - friend class Timer; - }; class Timer : public a8::Singleton { diff --git a/third_party/f8/f8/types.h b/third_party/f8/f8/types.h index 88d7153..3011237 100644 --- a/third_party/f8/f8/types.h +++ b/third_party/f8/f8/types.h @@ -20,4 +20,27 @@ namespace f8 IM_SysEnd = 99, }; + class TimerWp + { + public: + TimerWp(a8::XTimerWp wp): real_obj_(wp) {}; + TimerWp() {}; + bool expired() { return real_obj_.expired();}; + + private: + a8::XTimerWp real_obj_; + friend class Timer; + }; + + class Attacher + { + public: + Attacher(); + void ClearTimerList(); + + private: + a8::Attacher real_obj_; + friend class Timer; + }; + }