Skip to content

Commit

Permalink
Link cmark statically.
Browse files Browse the repository at this point in the history
libcmark.so is not symlinked properly in Arch Linux. It only has
libcmark.so -> libcmark.so.0.31.1 (for example). Anything that is
linked to libcmark will break after upgrading cmark. Usually it should
have a link libcmark.so.0 -> libcmark.so.0.31.1, so that if I upgrade
libcmark, I don’t have to recompile everything that is linked to it.
  • Loading branch information
MetroWind committed Sep 30, 2024
1 parent f6c9887 commit dbe5b5f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,19 @@ FetchContent_Declare(
GIT_TAG v1.12.0
)

FetchContent_Declare(
cmark
GIT_REPOSITORY https://github.com/commonmark/cmark.git
GIT_TAG 0.31.1
)

set(SPDLOG_USE_STD_FORMAT ON)
FetchContent_MakeAvailable(json inja httplib cxxopts googletest ryml spdlog)
FetchContent_MakeAvailable(json inja httplib cxxopts googletest ryml spdlog cmark)
unset(BUILD_BENCHMARK)

find_package(CURL REQUIRED)
find_package(SQLite3 REQUIRED)
find_package(cmark REQUIRED)
# find_package(cmark REQUIRED)

find_package(PkgConfig REQUIRED)
pkg_check_modules(libmagic REQUIRED libmagic)
Expand Down Expand Up @@ -108,17 +114,14 @@ set(LIBS
${SQLite3_LIBRARIES}
cryptopp::cryptopp
${libmagic_LIBRARIES}
# This can be found in the installed
# cmark-targets-relwithdebinfo.cmake.
cmark::cmark
cmark
)

set(INCLUDES
${CURL_INCLUDE_DIR}
${json_SOURCE_DIR}/single_include
${inja_SOURCE_DIR}/single_include/inja
${SQLite3_INCLUDE_DIRS}
${cmark_INCLUDE_DIRS}
${libmagic_INCLUDE_DIRS}
)

Expand Down

0 comments on commit dbe5b5f

Please sign in to comment.