Chore: embed yyjson source code

Ref: https://github.com/fastfetch-cli/fastfetch/discussions/523
This commit is contained in:
李通洲 2023-08-14 20:00:04 +08:00
parent a85da5401d
commit cd4a512291
No known key found for this signature in database
GPG Key ID: 6E72B663408769DE
6 changed files with 17137 additions and 24 deletions

View File

@ -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
@ -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 #
#####################
@ -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
@ -847,7 +830,6 @@ target_include_directories(libfastfetch
target_link_libraries(libfastfetch
PRIVATE ${CMAKE_DL_LIBS}
PRIVATE yyjson
)
######################
@ -862,7 +844,6 @@ target_compile_definitions(fastfetch
)
target_link_libraries(fastfetch
PRIVATE libfastfetch
PRIVATE yyjson
)
add_executable(flashfetch
@ -873,7 +854,6 @@ target_compile_definitions(flashfetch
)
target_link_libraries(flashfetch
PRIVATE libfastfetch
PRIVATE yyjson
)
if(WIN32)

6
src/3rdparty/yyjson/repo.json vendored Normal file
View File

@ -0,0 +1,6 @@
{
"home": "https://github.com/ibireme/yyjson",
"license": "MIT ( embed in source )",
"version": "5e3b26d2659287d31e2f8e10f95f95feb7e5ab3a",
"author": "ibireme"
}

9281
src/3rdparty/yyjson/yyjson.c vendored Normal file

File diff suppressed because it is too large Load Diff

7846
src/3rdparty/yyjson/yyjson.h vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -62,7 +62,6 @@ FF_MAYBE_UNUSED static void detectTTY(FFTerminalFontResult* terminalFont)
#include "common/processing.h"
#include <stdlib.h>
#include <yyjson.h>
static const char* detectWTProfile(yyjson_val* profile, FFstrbuf* name, double* size)
{

View File

@ -7,7 +7,8 @@
#include <stdint.h>
#include <stdbool.h>
#include <yyjson.h>
#include "3rdparty/yyjson/yyjson.h"
#include "util/FFstrbuf.h"
#include "util/FFlist.h"