diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2023-01-07 14:57:13 +0100 |
---|---|---|
committer | Joshua Goins <josh@redstrate.com> | 2023-01-12 10:08:52 -0500 |
commit | 22a2b7ac463e7ea339d4d57be3b770fbf09518bf (patch) | |
tree | c2eedd8f6fe7f75c916daf0ab93d976b2e39e6a8 | |
parent | aa7c910e262d4c3d655a9a7f853b52d7cd0641a9 (diff) | |
download | PrismLauncher-22a2b7ac463e7ea339d4d57be3b770fbf09518bf.tar.gz PrismLauncher-22a2b7ac463e7ea339d4d57be3b770fbf09518bf.tar.bz2 PrismLauncher-22a2b7ac463e7ea339d4d57be3b770fbf09518bf.zip |
refactor: support system and bundled cmark
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | CMakeLists.txt | 13 | ||||
-rw-r--r-- | launcher/CMakeLists.txt | 2 | ||||
m--------- | libraries/cmark | 0 |
4 files changed, 17 insertions, 1 deletions
diff --git a/.gitmodules b/.gitmodules index 95274f15..87703fee 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,3 +16,6 @@ [submodule "libraries/extra-cmake-modules"] path = libraries/extra-cmake-modules url = https://github.com/KDE/extra-cmake-modules +[submodule "libraries/cmark"] + path = libraries/cmark + url = https://github.com/commonmark/cmark.git diff --git a/CMakeLists.txt b/CMakeLists.txt index f235a2ac..2194317b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -266,6 +266,9 @@ if(NOT Launcher_FORCE_BUNDLED_LIBS) # Find ghc_filesystem find_package(ghc_filesystem QUIET) + + # Find cmark + find_package(cmark QUIET) endif() include(ECMQtDeclareLoggingCategory) @@ -407,6 +410,16 @@ if(NOT tomlplusplus_FOUND) else() message(STATUS "Using system tomlplusplus") endif() +if(NOT cmark_FOUND) + message(STATUS "Using bundled cmark") + set(CMARK_STATIC ON CACHE BOOL "Build static libcmark library" FORCE) + set(CMARK_SHARED OFF CACHE BOOL "Build shared libcmark library" FORCE) + set(CMARK_TESTS OFF CACHE BOOL "Build cmark tests and enable testing" FORCE) + add_subdirectory(libraries/cmark EXCLUDE_FROM_ALL) # Markdown parser + add_library(cmark::cmark ALIAS cmark_static) +else() + message(STATUS "Using system cmark") +endif() add_subdirectory(libraries/katabasis) # An OAuth2 library that tried to do too much add_subdirectory(libraries/gamemode) add_subdirectory(libraries/murmur2) # Hash for usage with the CurseForge API diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 7dc744aa..60acc6fc 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -1043,7 +1043,7 @@ target_link_libraries(Launcher_logic ) target_link_libraries(Launcher_logic QuaZip::QuaZip - cmark + cmark::cmark LocalPeer Launcher_rainbow ) diff --git a/libraries/cmark b/libraries/cmark new file mode 160000 +Subproject a8da5a2f252b96eca60ae8bada1a9ba059a3840 |