Skip to content

Commit

Permalink
Got cert tool building
Browse files Browse the repository at this point in the history
This is progress towards fixing ValveSoftware#186.  However, I need some help
publishing/installing (or whatever it's called) properly, and
there is probably a better way to integrate with picojson than
using a git submodule.
  • Loading branch information
zpostfacto committed Nov 24, 2021
1 parent e5bfae4 commit 5c793b9
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
[submodule "src/external/webrtc"]
path = src/external/webrtc
url = https://webrtc.googlesource.com/src
[submodule "src/external/picojson"]
path = src/external/picojson
url = https://github.com/kazuho/picojson.git
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ option(BUILD_STATIC_LIB "Build the static link version of the client library" ON
option(BUILD_SHARED_LIB "Build the shared library version of the client library" ON)
option(BUILD_EXAMPLES "Build the included examples" OFF)
option(BUILD_TESTS "Build crypto, pki and network connection tests" OFF)
option(BUILD_TOOLS "Build cert management tool" OFF)
option(LTO "Enable Link-Time Optimization" OFF)
option(USE_STEAMWEBRTC "Build Google's WebRTC library to get ICE support for P2P" OFF)
option(Protobuf_USE_STATIC_LIBS "Link with protobuf statically" OFF)
Expand Down
13 changes: 13 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,19 @@ if (BUILD_STATIC_LIB)
set_clientlib_target_properties(GameNetworkingSockets_s)
endif()

#
# Cert tool
#
if (BUILD_TOOLS)

# The cert tool requires picojson
# FIXME - somebody might be able to help figure this out
#find_package( picojson )
set(picojson_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/picojson)
if(NOT EXISTS ${picojson_SOURCE_DIR}/picojson.h)
message(FATAL_ERROR "picojson submodule not initialized.\n(Try: 'git submodule update src/external/picojson')" )
endif()

add_executable(steamnetworkingsockets_certtool
"steamnetworkingsockets/certtool/steamnetworkingsockets_certtool.cpp"
)
Expand All @@ -347,6 +359,7 @@ if (BUILD_TOOLS)
target_include_directories(steamnetworkingsockets_certtool PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>"
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}/GameNetworkingSockets>"
${picojson_SOURCE_DIR}
)

target_include_directories(steamnetworkingsockets_certtool PRIVATE
Expand Down
1 change: 1 addition & 0 deletions src/external/picojson
Submodule picojson added at 111c9b
4 changes: 3 additions & 1 deletion vcpkg_ports/gamenetworkingsockets/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ if ( ( "${CRYPTO_BACKEND}" STREQUAL "" ) OR ( "openssl" IN_LIST FEATURES ) )
set(CRYPTO_BACKEND "OpenSSL")
endif()

#
# Handle some simple options that we can just
# pass straight through to cmake
vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
webrtc USE_STEAMWEBRTC
examples BUILD_EXAMPLES
tests BUILD_TESTS
tools BUILD_TOOLS
)

# Check static versus dynamic in the triple. Our cmakefile can build both
Expand Down
5 changes: 4 additions & 1 deletion vcpkg_ports/gamenetworkingsockets/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
},
"tests": {
"description": "Build the tests."
},
"tools": {
"description": "Build cert management tool."
}
}
}
}

0 comments on commit 5c793b9

Please sign in to comment.