Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
RingRacers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dr_Nope
RingRacers
Commits
dd182cd0
Commit
dd182cd0
authored
2 years ago
by
Eidolon
Browse files
Options
Downloads
Patches
Plain Diff
cmake: Separate cpm discordrpc setup
parent
ac7ca100
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
thirdparty/CMakeLists.txt
+2
-76
2 additions, 76 deletions
thirdparty/CMakeLists.txt
thirdparty/cpm-discordrpc.cmake
+63
-0
63 additions, 0 deletions
thirdparty/cpm-discordrpc.cmake
thirdparty/cpm-rapidjson.cmake
+13
-0
13 additions, 0 deletions
thirdparty/cpm-rapidjson.cmake
with
78 additions
and
76 deletions
thirdparty/CMakeLists.txt
+
2
−
76
View file @
dd182cd0
...
...
@@ -209,85 +209,11 @@ if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}")
)
target_compile_features
(
gme PRIVATE cxx_std_11
)
target_link_libraries
(
gme PRIVATE ZLIB::ZLIB
)
endif
()
CPMAddPackage
(
NAME RapidJSON
VERSION 1.1.0
URL
"https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz"
EXCLUDE_FROM_ALL ON
DOWNLOAD_ONLY ON
)
if
(
RapidJSON_ADDED
)
add_library
(
RapidJSON INTERFACE
)
add_library
(
RapidJSON::RapidJSON ALIAS RapidJSON
)
target_include_directories
(
RapidJSON INTERFACE
"
${
RapidJSON_SOURCE_DIR
}
/include"
)
endif
()
CPMAddPackage
(
NAME DiscordRPC
VERSION 3.4.0
URL
"https://github.com/discord/discord-rpc/archive/refs/tags/v3.4.0.zip"
EXCLUDE_FROM_ALL ON
DOWNLOAD_ONLY ON
)
if
(
DiscordRPC_ADDED
)
set
(
DiscordRPC_SOURCES
include/discord_rpc.h
include/discord_register.h
src/discord_rpc.cpp
src/rpc_connection.h
src/rpc_connection.cpp
src/serialization.h
src/serialization.cpp
src/connection.h
src/backoff.h
src/msg_queue.h
)
list
(
TRANSFORM DiscordRPC_SOURCES PREPEND
"
${
DiscordRPC_SOURCE_DIR
}
/"
)
# Discord RPC is always statically linked because it's tiny.
add_library
(
discord-rpc STATIC
${
DiscordRPC_SOURCES
}
)
add_library
(
DiscordRPC::DiscordRPC ALIAS discord-rpc
)
target_include_directories
(
discord-rpc PUBLIC
"
${
DiscordRPC_SOURCE_DIR
}
/include"
)
target_compile_features
(
discord-rpc PUBLIC cxx_std_11
)
target_link_libraries
(
discord-rpc PRIVATE RapidJSON::RapidJSON
)
# Platform-specific connection and register impls
if
(
WIN32
)
target_compile_definitions
(
discord-rpc PUBLIC -DDISCORD_WINDOWS
)
target_sources
(
discord-rpc PRIVATE
"
${
DiscordRPC_SOURCE_DIR
}
/src/connection_win.cpp"
"
${
DiscordRPC_SOURCE_DIR
}
/src/discord_register_win.cpp"
)
target_link_libraries
(
discord-rpc PRIVATE psapi advapi32
)
endif
()
if
(
UNIX
)
target_sources
(
discord-rpc PRIVATE
"
${
DiscordRPC_SOURCE_DIR
}
/src/connection_unix.cpp"
)
if
(
APPLE
)
target_compile_definitions
(
discord-rpc PUBLIC -DDISCORD_OSX
)
target_sources
(
discord-rpc PRIVATE
"
${
DiscordRPC_SOURCE_DIR
}
/src/discord_register_osx.m"
)
target_link_libraries
(
discord-rpc PUBLIC
"-framework AppKit"
)
endif
()
if
(
UNIX AND NOT APPLE
)
target_compile_definitions
(
discord-rpc PUBLIC -DDISCORD_LINUX
)
target_sources
(
discord-rpc PRIVATE
"
${
DiscordRPC_SOURCE_DIR
}
/src/discord_register_linux.cpp"
)
endif
()
endif
()
endif
()
include
(
"cpm-rapidjson.cmake"
)
include
(
"cpm-discordrpc.cmake"
)
include
(
"cpm-xmp-lite.cmake"
)
add_subdirectory
(
tcbrindle_span
)
...
...
This diff is collapsed.
Click to expand it.
thirdparty/cpm-discordrpc.cmake
0 → 100644
+
63
−
0
View file @
dd182cd0
CPMAddPackage
(
NAME DiscordRPC
VERSION 3.4.0
URL
"https://github.com/discord/discord-rpc/archive/refs/tags/v3.4.0.zip"
EXCLUDE_FROM_ALL ON
DOWNLOAD_ONLY ON
)
if
(
DiscordRPC_ADDED
)
set
(
DiscordRPC_SOURCES
include/discord_rpc.h
include/discord_register.h
src/discord_rpc.cpp
src/rpc_connection.h
src/rpc_connection.cpp
src/serialization.h
src/serialization.cpp
src/connection.h
src/backoff.h
src/msg_queue.h
)
list
(
TRANSFORM DiscordRPC_SOURCES PREPEND
"
${
DiscordRPC_SOURCE_DIR
}
/"
)
# Discord RPC is always statically linked because it's tiny.
add_library
(
discord-rpc STATIC
${
DiscordRPC_SOURCES
}
)
add_library
(
DiscordRPC::DiscordRPC ALIAS discord-rpc
)
target_include_directories
(
discord-rpc PUBLIC
"
${
DiscordRPC_SOURCE_DIR
}
/include"
)
target_compile_features
(
discord-rpc PUBLIC cxx_std_11
)
target_link_libraries
(
discord-rpc PRIVATE RapidJSON::RapidJSON
)
# Platform-specific connection and register impls
if
(
WIN32
)
target_compile_definitions
(
discord-rpc PUBLIC -DDISCORD_WINDOWS
)
target_sources
(
discord-rpc PRIVATE
"
${
DiscordRPC_SOURCE_DIR
}
/src/connection_win.cpp"
"
${
DiscordRPC_SOURCE_DIR
}
/src/discord_register_win.cpp"
)
target_link_libraries
(
discord-rpc PRIVATE psapi advapi32
)
endif
()
if
(
UNIX
)
target_sources
(
discord-rpc PRIVATE
"
${
DiscordRPC_SOURCE_DIR
}
/src/connection_unix.cpp"
)
if
(
APPLE
)
target_compile_definitions
(
discord-rpc PUBLIC -DDISCORD_OSX
)
target_sources
(
discord-rpc PRIVATE
"
${
DiscordRPC_SOURCE_DIR
}
/src/discord_register_osx.m"
)
target_link_libraries
(
discord-rpc PUBLIC
"-framework AppKit"
)
endif
()
if
(
UNIX AND NOT APPLE
)
target_compile_definitions
(
discord-rpc PUBLIC -DDISCORD_LINUX
)
target_sources
(
discord-rpc PRIVATE
"
${
DiscordRPC_SOURCE_DIR
}
/src/discord_register_linux.cpp"
)
endif
()
endif
()
endif
()
This diff is collapsed.
Click to expand it.
thirdparty/cpm-rapidjson.cmake
0 → 100644
+
13
−
0
View file @
dd182cd0
CPMAddPackage
(
NAME RapidJSON
VERSION 1.1.0
URL
"https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz"
EXCLUDE_FROM_ALL ON
DOWNLOAD_ONLY ON
)
if
(
RapidJSON_ADDED
)
add_library
(
RapidJSON INTERFACE
)
add_library
(
RapidJSON::RapidJSON ALIAS RapidJSON
)
target_include_directories
(
RapidJSON INTERFACE
"
${
RapidJSON_SOURCE_DIR
}
/include"
)
endif
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment