Revamp: Transition HarmonyLink to C++ with DLL support
This transformative commit marks the evolution of HarmonyLink from a Rust-based server-side application to a C++ implemented, C-compatible dynamic link library (DLL). We've restructured the codebase to streamline integration into games, eliminating the need for a server setup by end-users. Key Changes: - Introduced .gitattributes and .gitmodules to manage new dependencies and collaborations. - Replaced the GitHub workflow files with CMake configurations to support the new C++ build system. - Introduced a comprehensive set of header and implementation files defining the core functionality, platform-specific utilities, and cross-platform compatibility layers. - Removed all Rust-specific files (Cargo.toml, Cargo.lock, etc.) and references to ensure a clean transition to the C++ environment. - Implemented new testing mechanisms within HarmonyLinkTest to ensure robustness and reliability of the DLL. - Excised previous server-side components and models to focus on the DLL's direct integration into consumer applications. This update is a direct response to community feedback, showcasing our commitment to adaptability and innovation. HarmonyLink 2.0 is now more accessible, efficient, and tailored for diverse gaming environments, providing developers with an unparalleled level of hardware-software harmony. Please refer to the updated README for more details on the new structure and how to integrate HarmonyLink 2.0 into your projects.
This commit is contained in:
parent
d13fc728df
commit
6bf68eb298
60 changed files with 1629 additions and 2389 deletions
70
CMakeLists.txt
Normal file
70
CMakeLists.txt
Normal file
|
@ -0,0 +1,70 @@
|
|||
cmake_minimum_required(VERSION 3.10)
|
||||
project(HarmonyLinkProject)
|
||||
|
||||
# Check the build type and display a message accordingly
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
message(STATUS "Building for Debug")
|
||||
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
message(STATUS "Building for Release")
|
||||
elseif(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
|
||||
message(STATUS "Building for MinSizeRel")
|
||||
elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
||||
message(STATUS "Building for RelWithDebInfo")
|
||||
else()
|
||||
message(STATUS "Building with unspecified build type")
|
||||
endif()
|
||||
|
||||
#set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
|
||||
# Platform-specific definitions
|
||||
if(WIN32)
|
||||
add_definitions(-DBUILD_WINDOWS)
|
||||
elseif(UNIX)
|
||||
if(APPLE)
|
||||
add_definitions(-DBUILD_MACOS)
|
||||
else()
|
||||
add_definitions(-DBUILD_LINUX)
|
||||
endif()
|
||||
add_definitions(-DBUILD_UNIX)
|
||||
endif()
|
||||
|
||||
# Set global output directories for all build types
|
||||
foreach(TYPE IN ITEMS DEBUG RELEASE)
|
||||
string(TOUPPER ${TYPE} TYPE_UPPER)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${TYPE_UPPER} "${CMAKE_BINARY_DIR}/bin/${TYPE}")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${TYPE_UPPER} "${CMAKE_BINARY_DIR}/lib/${TYPE}")
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${TYPE_UPPER} "${CMAKE_BINARY_DIR}/archive/${TYPE}")
|
||||
endforeach()
|
||||
|
||||
# Add the library and executable directories
|
||||
|
||||
add_subdirectory(HarmonyLinkLib)
|
||||
add_subdirectory(HarmonyLinkTest)
|
||||
|
||||
# Add Google Test as a subdirectory
|
||||
#add_subdirectory(ThirdParty/googletest)
|
||||
|
||||
# Enable testing
|
||||
#enable_testing()
|
||||
|
||||
# Include Google Test's include directory
|
||||
#include_directories(ThirdParty/googletest/googletest/include)
|
||||
|
||||
# Define your test executable
|
||||
#file(GLOB_RECURSE TEST_SOURCES "tests/*.cpp")
|
||||
#add_executable(Testing ${TEST_SOURCES})
|
||||
|
||||
# Set HarmonyLinkTest as the default startup project
|
||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT HarmonyLinkTest)
|
||||
|
||||
# Link Google Test and HarmonyLink library to the test executable
|
||||
#target_link_libraries(Testing gtest gtest_main gmock HarmonyLinkLib)
|
||||
|
||||
#add_custom_command(TARGET Testing POST_BUILD
|
||||
# COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
# "$<TARGET_FILE:HarmonyLinkLib>"
|
||||
# "$<TARGET_FILE_DIR:Testing>")
|
||||
|
||||
# Discover tests
|
||||
#include(GoogleTest)
|
||||
#gtest_discover_tests(Testing)
|
Loading…
Add table
Add a link
Reference in a new issue