Skip to content

Commit

Permalink
Chore: embed yyjson source code
Browse files Browse the repository at this point in the history
Ref: #523
  • Loading branch information
CarterLi committed Aug 14, 2023
1 parent a85da54 commit cd4a512
Show file tree
Hide file tree
Showing 6 changed files with 17,137 additions and 24 deletions.
24 changes: 2 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url & FetchContent
cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url

project(fastfetch
VERSION 2.0.0
Expand Down Expand Up @@ -36,24 +36,6 @@ endif()

include(CheckIncludeFile)

include(FetchContent)
function(ff_fetch_dep package repo tag)
FetchContent_Declare(
"${package}"
GIT_REPOSITORY "${repo}"
GIT_TAG "${tag}"
GIT_PROGRESS TRUE
)
FetchContent_GetProperties("${package}")
if(NOT ${package}_POPULATED)
message("-- Fetching dependency ${package}@${tag} from ${repo}")
FetchContent_Populate(${package})
add_subdirectory(${${package}_SOURCE_DIR} ${${package}_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
endfunction()

ff_fetch_dep(yyjson "https://github.com/ibireme/yyjson" "0.7.0")

#####################
# Configure options #
#####################
Expand Down Expand Up @@ -269,6 +251,7 @@ file(GENERATE OUTPUT logo_builtin.h CONTENT "${LOGO_BUILTIN_H}")
#######################

set(LIBFASTFETCH_SRC
src/3rdparty/yyjson/yyjson.c
src/common/bar.c
src/common/font.c
src/common/format.c
Expand Down Expand Up @@ -847,7 +830,6 @@ target_include_directories(libfastfetch

target_link_libraries(libfastfetch
PRIVATE ${CMAKE_DL_LIBS}
PRIVATE yyjson
)

######################
Expand All @@ -862,7 +844,6 @@ target_compile_definitions(fastfetch
)
target_link_libraries(fastfetch
PRIVATE libfastfetch
PRIVATE yyjson
)

add_executable(flashfetch
Expand All @@ -873,7 +854,6 @@ target_compile_definitions(flashfetch
)
target_link_libraries(flashfetch
PRIVATE libfastfetch
PRIVATE yyjson
)

if(WIN32)
Expand Down
6 changes: 6 additions & 0 deletions src/3rdparty/yyjson/repo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"home": "https://github.com/ibireme/yyjson",
"license": "MIT ( embed in source )",
"version": "5e3b26d2659287d31e2f8e10f95f95feb7e5ab3a",
"author": "ibireme"
}
Loading

0 comments on commit cd4a512

Please sign in to comment.