diff options
author | Aki <please@ignore.pl> | 2022-06-07 16:54:43 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-06-07 16:54:43 +0200 |
commit | b9e96d1b28eb5fa69f5c8e572e13695669354b23 (patch) | |
tree | 8f47178c46048b77d22fa4b0d92762a53f911c65 | |
parent | bf0ff8b3ae273ba52a79ff3952cf103f5ed131e3 (diff) | |
download | hwd-b9e96d1b28eb5fa69f5c8e572e13695669354b23.zip hwd-b9e96d1b28eb5fa69f5c8e572e13695669354b23.tar.gz hwd-b9e96d1b28eb5fa69f5c8e572e13695669354b23.tar.bz2 |
Renamed internal common to config
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | config/CMakeLists.txt (renamed from common/CMakeLists.txt) | 4 | ||||
-rw-r--r-- | config/include/hwd/config.h (renamed from common/include/hwd/internal.h) | 4 | ||||
-rw-r--r-- | config/src/config.cpp (renamed from common/src/internal.cpp) | 6 | ||||
-rw-r--r-- | daemon/CMakeLists.txt | 2 | ||||
-rw-r--r-- | daemon/src/daemon.cpp | 4 | ||||
-rw-r--r-- | library/CMakeLists.txt | 2 | ||||
-rw-r--r-- | library/src/client.cpp | 4 |
8 files changed, 14 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 20d0f18..25ce8e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS No) find_package(Threads REQUIRED) find_package(rpclib 2 REQUIRED) -add_subdirectory(common) +add_subdirectory(config) add_subdirectory(daemon) add_subdirectory(library) add_subdirectory(examples) diff --git a/common/CMakeLists.txt b/config/CMakeLists.txt index a126620..7fbe117 100644 --- a/common/CMakeLists.txt +++ b/config/CMakeLists.txt @@ -1,6 +1,6 @@ -project(common CXX) +project(config CXX) add_library(${PROJECT_NAME} STATIC - src/internal.cpp + src/config.cpp ) target_include_directories(${PROJECT_NAME} PUBLIC include diff --git a/common/include/hwd/internal.h b/config/include/hwd/config.h index 633c5a9..7f42cb5 100644 --- a/common/include/hwd/internal.h +++ b/config/include/hwd/config.h @@ -2,7 +2,7 @@ namespace hwd { -namespace internal +namespace config { constexpr int default_port = 4236; @@ -14,5 +14,5 @@ constexpr const char * host_variable = "HWDHOST"; int port(); const char * host(); -} // namespace internal +} // namespace config } // namespace hwd diff --git a/common/src/internal.cpp b/config/src/config.cpp index de1e7b0..8895a24 100644 --- a/common/src/internal.cpp +++ b/config/src/config.cpp @@ -1,11 +1,11 @@ -#include "hwd/internal.h" +#include "hwd/config.h" #include <cstdlib> namespace hwd { -namespace internal +namespace config { int port() @@ -23,5 +23,5 @@ const char * host() return default_host; } -} // namespace internal +} // namespace config } // namespace hwd diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 6a01e15..2f4c259 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -9,7 +9,7 @@ add_executable(${PROJECT_NAME} target_link_libraries(${PROJECT_NAME} PRIVATE rpclib::rpc PRIVATE Threads::Threads - PRIVATE common + PRIVATE config ) set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME hwd diff --git a/daemon/src/daemon.cpp b/daemon/src/daemon.cpp index 1b9dcab..aa34757 100644 --- a/daemon/src/daemon.cpp +++ b/daemon/src/daemon.cpp @@ -1,7 +1,7 @@ #include <rpc/server.h> #include <rpc/this_server.h> -#include <hwd/internal.h> +#include <hwd/config.h> #include "Assembly.h" #include "Gpio.h" @@ -16,7 +16,7 @@ static Sinewave sinewave; int main(int, char **) { - rpc::server server(hwd::internal::port()); + rpc::server server(hwd::config::port()); Assembly assembly {server}; assembly.add("gpio", gpio); assembly.add("memory", memory); diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index a454186..71ed16c 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -8,7 +8,7 @@ add_library(${PROJECT_NAME} SHARED target_link_libraries(${PROJECT_NAME} PUBLIC rpclib::rpc PUBLIC Threads::Threads - PRIVATE common + PRIVATE config ) target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>" diff --git a/library/src/client.cpp b/library/src/client.cpp index 187f36e..d58e411 100644 --- a/library/src/client.cpp +++ b/library/src/client.cpp @@ -2,11 +2,11 @@ #include <rpc/client.h> -#include <hwd/internal.h> +#include <hwd/config.h> rpc::client & get_client() { - static rpc::client c(hwd::internal::host(), hwd::internal::port()); + static rpc::client c(hwd::config::host(), hwd::config::port()); return c; } |