diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-24 16:53:50 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-24 16:54:08 +0100 |
| commit | 70cd59d1e9f831c8c0b5d0bd379218ff5db8314b (patch) | |
| tree | a91fb2d07ce17a7a2daed8735b46d0189c09e648 | |
| parent | 700510fe095085572250830dd7c2ff8b41023031 (diff) | |
feat: lib: add CMake build support.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
| -rw-r--r-- | CMakeLists.txt | 13 | ||||
| -rw-r--r-- | include/ocl/fix/parser.hpp | 13 | ||||
| -rw-r--r-- | src/fix/parser_impl.cpp | 2 | ||||
| -rw-r--r-- | test/fix_basic/CMakeLists.txt | 4 |
4 files changed, 24 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..343aee1 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,13 @@ +# PURPOSE: FIX module CMakeLists. + +cmake_minimum_required(VERSION 3.10) +project(ocl_fix) + +find_package(Boost REQUIRED) + +add_library(ocl_fix src/fix/parser_impl.cpp) +target_link_libraries(ocl_fix boost_core) +install(TARGETS ocl_fix DESTINATION lib) + +set_property(TARGET ocl_fix PROPERTY CXX_STANDARD 20) + diff --git a/include/ocl/fix/parser.hpp b/include/ocl/fix/parser.hpp index c288869..ffac652 100644 --- a/include/ocl/fix/parser.hpp +++ b/include/ocl/fix/parser.hpp @@ -26,7 +26,6 @@ namespace ocl::fix using tag_type = std::string; using value_type = std::string; - struct range final { char* bytes_{nullptr}; @@ -97,14 +96,18 @@ namespace ocl::fix /// @brief visitor object which returns a fix::range_buffer instance. class visitor final { - struct impl; - std::unique_ptr<impl> impl_; + struct impl; + std::unique_ptr<impl> impl_; + +#ifndef OCL_FIX_HAS_IMPL + struct impl {}; +#endif public: visitor(); - ~visitor(); + ~visitor(); - /// \brief Alias of visit. + /// \brief Alias of visit. range_buffer operator()(const std::string& in); /// @brief Visits a FIX message and parse it into a range_buffer object. diff --git a/src/fix/parser_impl.cpp b/src/fix/parser_impl.cpp index cc18035..b776dcd 100644 --- a/src/fix/parser_impl.cpp +++ b/src/fix/parser_impl.cpp @@ -78,7 +78,7 @@ namespace ocl::fix } }; - visitor::visitor() = default; + visitor::visitor() = default; visitor::~visitor() = default; /// \brief Alias of visit. diff --git a/test/fix_basic/CMakeLists.txt b/test/fix_basic/CMakeLists.txt index 6a92644..a173485 100644 --- a/test/fix_basic/CMakeLists.txt +++ b/test/fix_basic/CMakeLists.txt @@ -13,8 +13,8 @@ FetchContent_MakeAvailable(googletest) enable_testing() -add_executable(FIXTestBasic fix.test.cpp ../../src/fix/parser_impl.cpp) -target_link_libraries(FIXTestBasic gtest_main) +add_executable(FIXTestBasic fix.test.cpp) +target_link_libraries(FIXTestBasic gtest_main ocl_fix) set_property(TARGET FIXTestBasic PROPERTY CXX_STANDARD 20) target_include_directories(FIXTestBasic PUBLIC ../../include/ocl) |
