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..9c39fb3 --- /dev/null +++ b/deps/datcxx/flat-tree @@ -0,0 +1 @@ +Subproject commit 9c39fb381dc7f6752337649b8c0fd3ff6f20d954 diff --git a/deps/heapwolf/cxx-tap b/deps/heapwolf/cxx-tap new file mode 160000 index 0000000..dcf9911 --- /dev/null +++ b/deps/heapwolf/cxx-tap @@ -0,0 +1 @@ +Subproject commit dcf991109b4815dfeb08d146a96d1213e5f2cace 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