feat add spdlog
Some checks failed
sm-rpc / build (Debug, aarch64-linux-gnu) (push) Failing after 29s
sm-rpc / build (Debug, arm-linux-gnueabihf) (push) Failing after 16s
sm-rpc / build (Debug, host.gcc) (push) Failing after 11s
sm-rpc / build (Debug, mipsel-linux-gnu) (push) Failing after 12s
sm-rpc / build (Release, aarch64-linux-gnu) (push) Failing after 11s
sm-rpc / build (Release, arm-linux-gnueabihf) (push) Failing after 11s
sm-rpc / build (Release, host.gcc) (push) Failing after 12s
sm-rpc / build (Release, mipsel-linux-gnu) (push) Failing after 16s

This commit is contained in:
tqcq
2025-08-22 18:22:57 +08:00
parent 3d395b45f0
commit c68893bace
2331 changed files with 1306786 additions and 103 deletions

View File

@@ -0,0 +1,38 @@
# - Adds a compiler flag if it is supported by the compiler
#
# This function checks that the supplied compiler flag is supported and then
# adds it to the corresponding compiler flags
#
# add_c_compiler_flag(<FLAG> [<VARIANT>])
#
# - Example
#
# include(AddCCompilerFlag)
# add_c_compiler_flag(-Wall)
# add_c_compiler_flag(-no-strict-aliasing RELEASE)
# Requires CMake 2.6+
if(__add_c_compiler_flag)
return()
endif()
set(__add_c_compiler_flag INCLUDED)
include(CheckCCompilerFlag)
function(add_c_compiler_flag FLAG)
string(TOUPPER "HAVE_C_FLAG_${FLAG}" SANITIZED_FLAG)
string(REPLACE "+" "X" SANITIZED_FLAG ${SANITIZED_FLAG})
string(REGEX REPLACE "[^A-Za-z_0-9]" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
string(REGEX REPLACE "_+" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
check_c_compiler_flag("${FLAG}" ${SANITIZED_FLAG})
if(${${SANITIZED_FLAG}})
set(${SANITIZED_FLAG} ON PARENT_SCOPE )
set(VARIANT ${ARGV1})
if(ARGV1)
string(REGEX REPLACE "[^A-Za-z_0-9]" "_" VARIANT "${VARIANT}")
string(TOUPPER "_${VARIANT}" VARIANT)
endif()
set(CMAKE_C_FLAGS${VARIANT} "${CMAKE_C_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE)
endif()
endfunction()

View File

@@ -0,0 +1,37 @@
# - Adds a compiler flag if it is supported by the compiler
#
# This function checks that the supplied compiler flag is supported and then
# adds it to the corresponding compiler flags
#
# add_cxx_compiler_flag(<FLAG> [<VARIANT>])
#
# - Example
#
# include(AddCXXCompilerFlag)
# add_cxx_compiler_flag(-Wall)
# add_cxx_compiler_flag(-no-strict-aliasing RELEASE)
# Requires CMake 2.6+
if(__add_cxx_compiler_flag)
return()
endif()
set(__add_cxx_compiler_flag INCLUDED)
include(CheckCXXCompilerFlag)
function(add_cxx_compiler_flag FLAG)
string(TOUPPER "HAVE_CXX_FLAG_${FLAG}" SANITIZED_FLAG)
string(REPLACE "+" "X" SANITIZED_FLAG ${SANITIZED_FLAG})
string(REGEX REPLACE "[^A-Za-z_0-9]" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
string(REGEX REPLACE "_+" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
check_cxx_compiler_flag( "${FLAG}" ${SANITIZED_FLAG} )
if(${${SANITIZED_FLAG}})
set(VARIANT ${ARGV1})
if(ARGV1)
string(REGEX REPLACE "[^A-Za-z_0-9]" "_" VARIANT "${VARIANT}")
string(TOUPPER "_${VARIANT}" VARIANT)
endif()
set(CMAKE_CXX_FLAGS${VARIANT} "${CMAKE_CXX_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE)
endif()
endfunction()

View File

@@ -0,0 +1,47 @@
# - Determines the target architecture of the compilation
#
# This function checks the architecture that will be built by the compiler
# and sets a variable to the architecture
#
# determine_target_architecture(<OUTPUT_VAR>)
#
# - Example
#
# include(DetermineTargetArchitecture)
# determine_target_architecture(PROJECT_NAME_ARCHITECTURE)
if(__determine_target_architecture)
return()
endif()
set(__determine_target_architecture INCLUDED)
function(determine_target_architecture FLAG)
if (MSVC)
if("${MSVC_C_ARCHITECTURE_ID}" STREQUAL "X86")
set(ARCH "i686")
elseif("${MSVC_C_ARCHITECTURE_ID}" STREQUAL "x64")
set(ARCH "x86_64")
elseif("${MSVC_C_ARCHITECTURE_ID}" STREQUAL "ARM")
set(ARCH "arm")
else()
message(FATAL_ERROR "Failed to determine the MSVC target architecture: ${MSVC_C_ARCHITECTURE_ID}")
endif()
else()
execute_process(
COMMAND ${CMAKE_C_COMPILER} -dumpmachine
RESULT_VARIABLE RESULT
OUTPUT_VARIABLE ARCH
ERROR_QUIET
)
if (RESULT)
message(FATAL_ERROR "Failed to determine target architecture triplet: ${RESULT}")
endif()
string(REGEX MATCH "([^-]+).*" ARCH_MATCH ${ARCH})
if (NOT CMAKE_MATCH_1 OR NOT ARCH_MATCH)
message(FATAL_ERROR "Failed to match the target architecture triplet: ${ARCH}")
endif()
set(ARCH ${CMAKE_MATCH_1})
endif()
message(STATUS "Target architecture - ${ARCH}")
set(FLAG ${ARCH} PARENT_SCOPE)
endfunction()

View File

@@ -0,0 +1,46 @@
#.rst:
# FindLibDl
# --------
#
# Find the native realtime includes and library.
#
# IMPORTED Targets
# ^^^^^^^^^^^^^^^^
#
# This module defines :prop_tgt:`IMPORTED` target ``LIBDL::LIBDL``, if
# LIBDL has been found.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module defines the following variables:
#
# ::
#
# LIBDL_INCLUDE_DIRS - where to find dlfcn.h, etc.
# LIBDL_LIBRARIES - List of libraries when using libdl.
# LIBDL_FOUND - True if dynamic linking library found.
#
# Hints
# ^^^^^
#
# A user may set ``LIBDL_ROOT`` to a library installation root to tell this
# module where to look.
find_path(LIBDL_INCLUDE_DIRS
NAMES dlfcn.h
PATHS ${LIBDL_ROOT}/include/
)
find_library(LIBDL_LIBRARIES dl)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibDl DEFAULT_MSG LIBDL_LIBRARIES LIBDL_INCLUDE_DIRS)
mark_as_advanced(LIBDL_INCLUDE_DIRS LIBDL_LIBRARIES)
if(LIBDL_FOUND)
if(NOT TARGET LIBDL::LIBDL)
add_library(LIBDL::LIBDL UNKNOWN IMPORTED)
set_target_properties(LIBDL::LIBDL PROPERTIES
IMPORTED_LOCATION "${LIBDL_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${LIBDL_INCLUDE_DIRS}")
endif()
endif()

View File

@@ -0,0 +1,47 @@
#.rst:
# FindLibM
# --------
#
# Find the native realtime includes and library.
#
# IMPORTED Targets
# ^^^^^^^^^^^^^^^^
#
# This module defines :prop_tgt:`IMPORTED` target ``LIBM::LIBM``, if
# LIBM has been found.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module defines the following variables:
#
# ::
#
# LIBM_INCLUDE_DIRS - where to find math.h, etc.
# LIBM_LIBRARIES - List of libraries when using libm.
# LIBM_FOUND - True if math library found.
#
# Hints
# ^^^^^
#
# A user may set ``LIBM_ROOT`` to a math library installation root to tell this
# module where to look.
find_path(LIBM_INCLUDE_DIRS
NAMES math.h
PATHS /usr/include /usr/local/include /usr/local/bic/include
NO_DEFAULT_PATH
)
find_library(LIBM_LIBRARIES m)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibM DEFAULT_MSG LIBM_LIBRARIES LIBM_INCLUDE_DIRS)
mark_as_advanced(LIBM_INCLUDE_DIRS LIBM_LIBRARIES)
if(LIBM_FOUND)
if(NOT TARGET LIBM::LIBM)
add_library(LIBM::LIBM UNKNOWN IMPORTED)
set_target_properties(LIBM::LIBM PROPERTIES
IMPORTED_LOCATION "${LIBM_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${LIBM_INCLUDE_DIRS}")
endif()
endif()

View File

@@ -0,0 +1,46 @@
#.rst:
# FindLibRt
# --------
#
# Find the native realtime includes and library.
#
# IMPORTED Targets
# ^^^^^^^^^^^^^^^^
#
# This module defines :prop_tgt:`IMPORTED` target ``LIBRT::LIBRT``, if
# LIBRT has been found.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module defines the following variables:
#
# ::
#
# LIBRT_INCLUDE_DIRS - where to find time.h, etc.
# LIBRT_LIBRARIES - List of libraries when using librt.
# LIBRT_FOUND - True if realtime library found.
#
# Hints
# ^^^^^
#
# A user may set ``LIBRT_ROOT`` to a realtime installation root to tell this
# module where to look.
find_path(LIBRT_INCLUDE_DIRS
NAMES time.h
PATHS ${LIBRT_ROOT}/include/
)
find_library(LIBRT_LIBRARIES rt)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibRt DEFAULT_MSG LIBRT_LIBRARIES LIBRT_INCLUDE_DIRS)
mark_as_advanced(LIBRT_INCLUDE_DIRS LIBRT_LIBRARIES)
if(LIBRT_FOUND)
if(NOT TARGET LIBRT::LIBRT)
add_library(LIBRT::LIBRT UNKNOWN IMPORTED)
set_target_properties(LIBRT::LIBRT PROPERTIES
IMPORTED_LOCATION "${LIBRT_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${LIBRT_INCLUDE_DIRS}")
endif()
endif()

View File

@@ -0,0 +1,112 @@
#.rst:
# FindWinSock
# --------
#
# Find the native realtime includes and library.
#
# IMPORTED Targets
# ^^^^^^^^^^^^^^^^
#
# This module defines :prop_tgt:`IMPORTED` target ``WINSOCK::WINSOCK``, if
# WINSOCK has been found.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module defines the following variables:
#
# ::
#
# WINSOCK_INCLUDE_DIRS - where to find winsock.h, etc.
# WINSOCK_LIBRARIES - List of libraries when using librt.
# WINSOCK_FOUND - True if realtime library found.
#
# Hints
# ^^^^^
#
# A user may set ``WINSOCK_ROOT`` to a realtime installation root to tell this
# module where to look.
macro(REMOVE_DUPLICATE_PATHS LIST_VAR)
set(WINSOCK_LIST "")
foreach(PATH IN LISTS ${LIST_VAR})
get_filename_component(PATH "${PATH}" REALPATH)
list(APPEND WINSOCK_LIST "${PATH}")
endforeach(PATH)
set(${LIST_VAR} ${WINSOCK_LIST})
list(REMOVE_DUPLICATES ${LIST_VAR})
endmacro(REMOVE_DUPLICATE_PATHS)
set(WINSOCK_INCLUDE_PATHS "${WINSOCK_ROOT}/include/")
if(MINGW)
file(TOUCH ${CMAKE_BINARY_DIR}/nul)
execute_process(
COMMAND ${CMAKE_C_COMPILER} -xc -E -v -
RESULT_VARIABLE RESULT
INPUT_FILE nul
ERROR_VARIABLE ERR
OUTPUT_QUIET
)
if (NOT RESULT)
string(FIND "${ERR}" "#include <...> search starts here:" START)
string(FIND "${ERR}" "End of search list." END)
if (NOT ${START} EQUAL -1 AND NOT ${END} EQUAL -1)
math(EXPR START "${START} + 36")
math(EXPR END "${END} - 1")
math(EXPR LENGTH "${END} - ${START}")
string(SUBSTRING "${ERR}" ${START} ${LENGTH} WINSOCK_INCLUDE_PATHS)
string(REPLACE "\n " ";" WINSOCK_INCLUDE_PATHS "${WINSOCK_INCLUDE_PATHS}")
list(REVERSE WINSOCK_INCLUDE_PATHS)
endif()
endif()
endif()
remove_duplicate_paths(WINSOCK_INCLUDE_PATHS)
set(WINSOCK_LIBRARY_PATHS "${WINSOCK_ROOT}/lib/")
if(MINGW)
execute_process(
COMMAND ${CMAKE_C_COMPILER} -print-search-dirs
RESULT_VARIABLE RESULT
OUTPUT_VARIABLE OUT
ERROR_QUIET
)
if (NOT RESULT)
string(REGEX MATCH "libraries: =([^\r\n]*)" OUT "${OUT}")
if(CMAKE_HOST_WIN32)
message(STATUS "not replacing ${_SEARCH_PATHS}")
list(APPEND WINSOCK_LIBRARY_PATHS "${CMAKE_MATCH_1}")
else()
# On Unix-like host systems, search dirs are separated by ':'.
# Thus we need to replace ':' with ';' to make a valid cmake list.
string(REPLACE ":" ";" _SEARCH_PATHS "${CMAKE_MATCH_1}")
list(APPEND WINSOCK_LIBRARY_PATHS "${_SEARCH_PATHS}")
unset(_SEARCH_PATHS)
endif()
endif()
endif()
if ("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "AMD64" AND "${CMAKE_SIZEOF_VOID_P}" EQUAL 4)
list(APPEND WINSOCK_LIBRARY_PATHS "C:/Windows/SysWOW64")
endif()
list(APPEND WINSOCK_LIBRARY_PATHS "C:/Windows/System32")
remove_duplicate_paths(WINSOCK_LIBRARY_PATHS)
find_path(WINSOCK_INCLUDE_DIRS
NAMES winsock2.h
PATHS ${WINSOCK_INCLUDE_PATHS}
)
find_library(WINSOCK_LIBRARIES ws2_32
PATHS ${WINSOCK_LIBRARY_PATHS}
NO_DEFAULT_PATH
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WinSock DEFAULT_MSG WINSOCK_LIBRARIES WINSOCK_INCLUDE_DIRS)
mark_as_advanced(WINSOCK_INCLUDE_DIRS WINSOCK_LIBRARIES)
if(WINSOCK_FOUND)
if(NOT TARGET WINSOCK::WINSOCK)
add_library(WINSOCK::WINSOCK UNKNOWN IMPORTED)
set_target_properties(WINSOCK::WINSOCK PROPERTIES
IMPORTED_LOCATION "${WINSOCK_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${WINSOCK_INCLUDE_DIRS}")
endif()
endif()

View File

@@ -0,0 +1,33 @@
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
set_and_check(civetweb_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
set_and_check(civetweb_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
set_and_check(civetweb_LIBRARY_DIRS "@PACKAGE_CMAKE_INSTALL_LIBDIR@")
set(civetweb_LIBRARIES civetweb)
if(@CIVETWEB_ENABLE_CXX@)
set(civetweb-cpp_LIBRARIES civetweb-cpp)
endif()
find_dependency(Threads)
set(CIVETWEB_SAVED_MODULE_PATH ${CMAKE_MODULE_PATH})
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
if(@LOOKUP_LIBDL@)
find_dependency(LibDl)
endif()
if(@LOOKUP_LIBRT@)
find_dependency(LibRt)
endif()
if(@LOOKUP_WINSOCK@)
find_dependency(WinSock)
endif()
set(CMAKE_MODULE_PATH ${CIVETWEB_SAVED_MODULE_PATH})
unset(CIVETWEB_SAVED_MODULE_PATH)
include("${CMAKE_CURRENT_LIST_DIR}/civetweb-targets.cmake")

View File

@@ -0,0 +1,12 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
Name: @PROJECT_NAME@-cpp
Description: generic graph library
Version: @PROJECT_VERSION@
Requires:
Libs: -L${libdir} -l@PROJECT_NAME@-cpp
Cflags: -I${includedir}

View File

@@ -0,0 +1,13 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
Name: @PROJECT_NAME@
Description: generic graph library
Version: @PROJECT_VERSION@
Requires:
Libs: -L${libdir} -l@PROJECT_NAME@
Cflags: -I${includedir}