Skip to content

Commit

Permalink
Add optional msquic dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
kaetemi committed Feb 21, 2023
1 parent c067b93 commit ecfea66
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ IF(WITH_ASSIMP)
FIND_PACKAGE(assimp REQUIRED)
ENDIF()

IF(WITH_MSQUIC)
FIND_PACKAGE(msquic REQUIRED)
ENDIF()

IF(WITH_NEL)
IF(WITH_NEL_TESTS)
FIND_PACKAGE(CppTest)
Expand Down
4 changes: 4 additions & 0 deletions CMakeModules/ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ MACRO(NL_CONFIGURE_CHECKS)
SET(NL_XAUDIO2_AVAILABLE 1)
ENDIF()

IF(WITH_MSQUIC)
SET(NL_MSQUIC_AVAILABLE 1)
ENDIF()

IF(NOT RYZOM_VERSION_MAJOR)
SET(RYZOM_VERSION_MAJOR ${NL_VERSION_MAJOR})
SET(RYZOM_VERSION_MINOR ${NL_VERSION_MINOR})
Expand Down
42 changes: 42 additions & 0 deletions CMakeModules/Findmsquic.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
IF(msquic_FIND_REQUIRED)
SET(msquic_FIND_REQUIRED ON)
ENDIF()

FIND_PATH(
msquic_INCLUDE_DIRS
NAMES msquic.h
PATHS /usr/local/include/
)

FIND_LIBRARY(
msquic_LIBRARY_RELEASE
NAMES msquic
PATHS /usr/local/lib/
)

FIND_LIBRARY(
msquic_LIBRARY_DEBUG
NAMES msquicd
PATHS /usr/local/lib/
)

IF (msquic_INCLUDE_DIRS)
SET(msquic_FOUND TRUE)
IF(msquic_LIBRARY_RELEASE AND msquic_LIBRARY_DEBUG)
SET(msquic_LIBRARIES ${msquic_LIBRARIES} optimized ${msquic_LIBRARY_RELEASE})
SET(msquic_LIBRARIES ${msquic_LIBRARIES} debug ${msquic_LIBRARY_DEBUG})
ENDIF()
IF(msquic_LIBRARY_RELEASE)
SET(msquic_LIBRARIES ${msquic_LIBRARIES} ${msquic_LIBRARY_RELEASE})
ENDIF()
ENDIF()

IF (msquic_FOUND)
IF (NOT msquic_FIND_QUIETLY)
MESSAGE(STATUS "Found msquic library: ${msquic_LIBRARIES}")
ENDIF ()
ELSE (msquic_FOUND)
IF (msquic_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find msquic library")
ENDIF ()
ENDIF ()
1 change: 1 addition & 0 deletions CMakeModules/nel.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
OPTION(WITH_LIBGSF "Use libgsf for max file library" OFF)

OPTION(WITH_FFMPEG "Use ffmpeg for audio decoder" OFF)
OPTION(WITH_MSQUIC "Use msquic for QUIC networking support" OFF)

###
# GUI toolkits
Expand Down
2 changes: 2 additions & 0 deletions config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

#cmakedefine NL_STEREO_AVAILABLE ${NL_STEREO_AVAILABLE}

#cmakedefine NL_MSQUIC_AVAILABLE ${NL_MSQUIC_AVAILABLE}

#cmakedefine NL_BIN_PREFIX "${NL_BIN_ABSOLUTE_PREFIX}"
#cmakedefine NL_ETC_PREFIX "${NL_ETC_ABSOLUTE_PREFIX}"
#cmakedefine NL_SHARE_PREFIX "${NL_SHARE_ABSOLUTE_PREFIX}"
Expand Down
7 changes: 7 additions & 0 deletions ryzom/server/src/frontend_service/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ LIST(REMOVE_ITEM SRC
${CMAKE_CURRENT_SOURCE_DIR}/property_dispatcher.cpp
${CMAKE_CURRENT_SOURCE_DIR}/property_dispatcher.h)

SOURCE_GROUP("" FILES ${SRC})

ADD_EXECUTABLE(ryzom_frontend_service WIN32 ${SRC})

INCLUDE_DIRECTORIES(${MYSQL_INCLUDE_DIR})
Expand All @@ -21,6 +23,11 @@ TARGET_LINK_LIBRARIES(ryzom_frontend_service
nelgeorges
nelligo)

IF(WITH_MSQUIC)
INCLUDE_DIRECTORIES(${msquic_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(ryzom_frontend_service ${msquic_LIBRARIES})
ENDIF()

NL_DEFAULT_PROPS(ryzom_frontend_service "Ryzom, Services: Frontend Service (FS)")
NL_ADD_RUNTIME_FLAGS(ryzom_frontend_service)

Expand Down

0 comments on commit ecfea66

Please sign in to comment.