-
Notifications
You must be signed in to change notification settings - Fork 69
Refactor JSON Parsing to Use Boost.JSON #202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| cmake_minimum_required(VERSION 3.15) | ||
|
|
||
| # Define the project | ||
| project(LogMonitor) | ||
|
|
||
| # Set C++ standard | ||
| set(CMAKE_CXX_STANDARD 17) | ||
| set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
| set(CMAKE_VERBOSE_MAKEFILE ON) | ||
| set(CMAKE_BUILD_TYPE Release) | ||
| set(VCPKG_TARGET_TRIPLET x64-windows) | ||
|
|
||
| # Use vcpkg if available | ||
| if (DEFINED ENV{VCPKG_ROOT}) | ||
| set(VCPKG_ROOT $ENV{VCPKG_ROOT}) | ||
| set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "Toolchain file for vcpkg" FORCE) | ||
|
|
||
| # Set Boost paths | ||
| set(BOOST_ROOT "${VCPKG_ROOT}/installed/x64-windows" CACHE PATH "Boost installation root") | ||
| set(Boost_INCLUDE_DIR "${VCPKG_ROOT}/installed/x64-windows/include" CACHE PATH "Boost include directory") | ||
|
|
||
| # Set Google Test paths | ||
| set(GTest_INCLUDE_DIRS "${VCPKG_ROOT}/installed/x64-windows/include" CACHE PATH "Google Test include directory") | ||
| endif() | ||
|
|
||
| # Set Windows SDK version if available | ||
| if (DEFINED ENV{SDKVersion}) | ||
| set(CMAKE_SYSTEM_VERSION $ENV{SDKVersion}) | ||
| endif() | ||
|
|
||
| # Enable testing framework | ||
| enable_testing() | ||
|
|
||
| # Enable Unicode globally | ||
| add_definitions(-DUNICODE -D_UNICODE) | ||
|
|
||
| # Include subdirectories for main and test executables | ||
| add_subdirectory(src) # Add main executable's CMake | ||
| add_subdirectory(LogMonitorTests) # Add test executable's CMake | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| cmake_minimum_required(VERSION 3.15) | ||
|
|
||
| project(LogMonitorTests) | ||
|
|
||
| find_package(Boost REQUIRED) | ||
|
|
||
| # Automatically gather all test source files | ||
| file(GLOB_RECURSE TEST_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.cpp") | ||
|
|
||
| # Ensure all source files exist before proceeding | ||
| if(NOT TEST_SOURCES) | ||
| message(FATAL_ERROR "No valid source files found for LogMonitorTests.") | ||
| endif() | ||
|
|
||
| # Define test shared library (DLL) | ||
| add_library(LogMonitorTests SHARED ${TEST_SOURCES}) | ||
|
|
||
| # Add a definition for symbol exporting | ||
| target_compile_definitions(LogMonitorTests PRIVATE LOGMONITORTESTS_EXPORTS) | ||
|
|
||
| # Include directories (for headers) | ||
| target_include_directories(LogMonitorTests PRIVATE | ||
| ${CMAKE_CURRENT_SOURCE_DIR} # Includes Utility.h and pch.h | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/../src | ||
| ${Boost_INCLUDE_DIRS} | ||
| ) | ||
|
|
||
| # Set Windows-specific linker flags | ||
| set_target_properties(LogMonitorTests PROPERTIES | ||
| COMPILE_PDB_NAME "LogMonitorTests" | ||
| COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" | ||
| LINK_FLAGS "/DEBUG:FULL /OPT:REF /OPT:ICF" | ||
| RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" | ||
| ) | ||
|
|
||
| # Link with LogMonitor and Boost | ||
| target_link_libraries(LogMonitorTests PRIVATE LogMonitor ${Boost_LIBRARIES}) | ||
|
|
||
| # Enable testing | ||
| enable_testing() | ||
|
|
||
| add_test(NAME LogMonitorTests COMMAND LogMonitorTests) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.