From 126bfe323862e967af11cd3ebef309822580ba1d Mon Sep 17 00:00:00 2001 From: 0xloem <0xloem@gmail.com> Date: Fri, 12 Mar 2021 05:21:11 -0500 Subject: [PATCH 1/3] Added cmake buildfile --- .gitmodules | 6 ++++++ CMakeLists.txt | 21 +++++++++++++++++++++ deps/datcxx/flat-tree | 1 + deps/heapwolf/cxx-tap | 1 + 4 files changed, 29 insertions(+) create mode 100644 .gitmodules create mode 100644 CMakeLists.txt create mode 160000 deps/datcxx/flat-tree create mode 160000 deps/heapwolf/cxx-tap diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e3b1f01 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "deps/datcxx/cxx-tap"] + path = deps/heapwolf/cxx-tap + url = https://github.com/xloem/tap.git +[submodule "deps/datcxx/flat-tree"] + path = deps/datcxx/flat-tree + url = https://github.com/xloem/flat-tree.git diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..74aced9 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.10) + +project(hypercore) + +execute_process(COMMAND git submodule update --init --recursive WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + +add_subdirectory(deps/datcxx/flat-tree) +add_subdirectory(deps/heapwolf/cxx-tap) + +add_library(${PROJECT_NAME} index.cxx) +target_link_libraries(${PROJECT_NAME} timers eventemitter tap) + +target_include_directories(${PROJECT_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/..) +install(FILES index.hxx DESTINATION include/${PROJECT_NAME}) + +include(CTest) +if(BUILD_TESTING) + add_executable(${PROJECT_NAME}-test test/index.cxx) + target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) + add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME}-test) +endif() diff --git a/deps/datcxx/flat-tree b/deps/datcxx/flat-tree new file mode 160000 index 0000000..aa7940a --- /dev/null +++ b/deps/datcxx/flat-tree @@ -0,0 +1 @@ +Subproject commit aa7940a03f292991e9f3d79bd7d4f3e455388561 diff --git a/deps/heapwolf/cxx-tap b/deps/heapwolf/cxx-tap new file mode 160000 index 0000000..27aa4f5 --- /dev/null +++ b/deps/heapwolf/cxx-tap @@ -0,0 +1 @@ +Subproject commit 27aa4f565887be340505752bf3c0d61339c5bd6a From 0fba1d22c4841d6c7a964a980068fde4346348f6 Mon Sep 17 00:00:00 2001 From: xloem <0xloem@gmail.com> Date: Thu, 24 Jun 2021 12:19:38 +0000 Subject: [PATCH 2/3] update submodules --- deps/datcxx/flat-tree | 2 +- deps/heapwolf/cxx-tap | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deps/datcxx/flat-tree b/deps/datcxx/flat-tree index aa7940a..9c39fb3 160000 --- a/deps/datcxx/flat-tree +++ b/deps/datcxx/flat-tree @@ -1 +1 @@ -Subproject commit aa7940a03f292991e9f3d79bd7d4f3e455388561 +Subproject commit 9c39fb381dc7f6752337649b8c0fd3ff6f20d954 diff --git a/deps/heapwolf/cxx-tap b/deps/heapwolf/cxx-tap index 27aa4f5..dcf9911 160000 --- a/deps/heapwolf/cxx-tap +++ b/deps/heapwolf/cxx-tap @@ -1 +1 @@ -Subproject commit 27aa4f565887be340505752bf3c0d61339c5bd6a +Subproject commit dcf991109b4815dfeb08d146a96d1213e5f2cace From 51d2dcd0aa7154601530faa2959b8ccd8dc3ea76 Mon Sep 17 00:00:00 2001 From: xloem <0xloem@gmail.com> Date: Thu, 24 Jun 2021 12:20:38 +0000 Subject: [PATCH 3/3] Update stub for newer flat-tree namespace --- index.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/index.cxx b/index.cxx index 06d1408..81252c4 100644 --- a/index.cxx +++ b/index.cxx @@ -1,8 +1,10 @@ #include "index.hxx" #include "deps/datcxx/flat-tree/index.hxx" -namespace Hypercore { - size_t getIndex () { - return flatTree::index(0, 0); - } -} // namespace Hypercore +namespace Hyper { + namespace Core { + size_t getIndex () { + return FlatTree::index(0, 0); + } + } // namespace Core +} // namespace Hyper