Skip to content

Commit 14fcfc5

Browse files
Merge pull request #4 from shadps4-emu/registration_fixes
Account,friends protobuf3 migration
2 parents 5759f4a + ebc7bed commit 14fcfc5

31 files changed

Lines changed: 1184 additions & 1063 deletions

CMakeLists.txt

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ set(CMAKE_CXX_STANDARD 17)
55
set(CMAKE_CXX_STANDARD_REQUIRED ON)
66
set(CMAKE_AUTOMOC ON)
77

8-
# === CRITICAL FIX: Set runtime library consistently ===
8+
# === Runtime library: must match Qt6 which always uses DLL runtime ===
99
if(MSVC)
10-
cmake_policy(SET CMP0091 NEW) # Enable runtime library selection
11-
# Use static runtime for consistency with your protobuf/abseil
12-
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
13-
14-
# Fix exception handling and UTF-8 warnings
10+
cmake_policy(SET CMP0091 NEW)
11+
# /MD (release) or /MDd (debug) — DLL runtime, same as Qt6.
12+
# protobuf_MSVC_STATIC_RUNTIME=OFF ensures protobuf follows the same setting.
13+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
14+
set(protobuf_MSVC_STATIC_RUNTIME OFF CACHE BOOL "" FORCE)
1515
add_compile_options(/EHsc /utf-8)
16+
# Remove /VERBOSE:LIB from link options (noisy, only needed for debugging)
1617
endif()
1718

1819
find_package(Qt6 REQUIRED COMPONENTS Core Network Sql Concurrent)
@@ -24,16 +25,16 @@ file(MAKE_DIRECTORY "${PROTO_OUT}")
2425

2526
add_custom_command(
2627
OUTPUT
27-
"${PROTO_OUT}/score_messages.pb.cc"
28-
"${PROTO_OUT}/score_messages.pb.h"
28+
"${PROTO_OUT}/shadnet.pb.cc"
29+
"${PROTO_OUT}/shadnet.pb.h"
2930
COMMAND $<TARGET_FILE:protoc>
3031
"--proto_path=${CMAKE_CURRENT_SOURCE_DIR}/src"
3132
"--cpp_out=${PROTO_OUT}"
32-
"${CMAKE_CURRENT_SOURCE_DIR}/src/score_messages.proto"
33+
"${CMAKE_CURRENT_SOURCE_DIR}/src/shadnet.proto"
3334
DEPENDS
34-
"${CMAKE_CURRENT_SOURCE_DIR}/src/score_messages.proto"
35+
"${CMAKE_CURRENT_SOURCE_DIR}/src/shadnet.proto"
3536
protoc
36-
COMMENT "Generating score_messages protobuf sources"
37+
COMMENT "Generating shadnet protobuf sources"
3738
VERBATIM
3839
)
3940

@@ -59,7 +60,7 @@ set(SOURCES
5960
src/score_files.h
6061
src/cmd_score.cpp
6162
src/proto_utils.h
62-
"${PROTO_OUT}/score_messages.pb.cc"
63+
"${PROTO_OUT}/shadnet.pb.cc"
6364
)
6465

6566
add_executable(shadnet ${SOURCES})
@@ -78,9 +79,6 @@ target_link_libraries(shadnet PRIVATE
7879
libprotobuf
7980
)
8081

81-
# Optional: Add this to see what runtime libraries are being used
82-
if(MSVC)
83-
target_link_options(shadnet PRIVATE /VERBOSE:LIB)
84-
endif()
82+
8583

8684
install(TARGETS shadnet RUNTIME DESTINATION bin)

clientsample/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,24 @@ file(MAKE_DIRECTORY "${PROTO_OUT}")
2222

2323
add_custom_command(
2424
OUTPUT
25-
"${PROTO_OUT}/score.pb.cc"
26-
"${PROTO_OUT}/score.pb.h"
25+
"${PROTO_OUT}/shadnet.pb.cc"
26+
"${PROTO_OUT}/shadnet.pb.h"
2727
COMMAND $<TARGET_FILE:protoc>
28-
"--proto_path=${CMAKE_CURRENT_SOURCE_DIR}/proto"
28+
"--proto_path=${CMAKE_CURRENT_SOURCE_DIR}"
2929
"--cpp_out=${PROTO_OUT}"
30-
"${CMAKE_CURRENT_SOURCE_DIR}/proto/score.proto"
30+
"${CMAKE_CURRENT_SOURCE_DIR}/shadnet.proto"
3131
DEPENDS
32-
"${CMAKE_CURRENT_SOURCE_DIR}/proto/score.proto"
32+
"${CMAKE_CURRENT_SOURCE_DIR}/shadnet.proto"
3333
protoc
34-
COMMENT "Generating score protobuf sources"
34+
COMMENT "Generating shadnet protobuf sources"
3535
VERBATIM
3636
)
3737

3838
add_executable(shadnet-sample
3939
main.cpp
4040
client.cpp
4141
connection.cpp
42-
"${PROTO_OUT}/score.pb.cc"
42+
"${PROTO_OUT}/shadnet.pb.cc"
4343
)
4444

4545
target_include_directories(shadnet-sample PRIVATE

0 commit comments

Comments
 (0)