Skip to content

Commit

Permalink
Use FetchContent instead including subtree
Browse files Browse the repository at this point in the history
因为白酱不喜欢有这么多文件
  • Loading branch information
rsp4jack committed Jan 24, 2024
1 parent 8e626b9 commit 39a78d4
Show file tree
Hide file tree
Showing 42 changed files with 47 additions and 13,656 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/encodingcheck/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,27 @@ cmake_minimum_required(VERSION 3.17)
project(encodingcheck LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)

add_subdirectory(xdgmime)
add_subdirectory(is_utf8)
include(FetchContent)

FetchContent_Declare(
xdgmime
GIT_REPOSITORY https://gitlab.freedesktop.org/xdg/xdgmime.git
GIT_TAG master
)

FetchContent_Declare(
is_utf8
GIT_REPOSITORY https://github.com/simdutf/is_utf8.git
GIT_TAG v1.3.1
)

FetchContent_MakeAvailable(xdgmime is_utf8)

message(xdgmime_SOURCE_DIR=${xdgmime_SOURCE_DIR})

set(xdgmime_SOURCE_DIR ${xdgmime_SOURCE_DIR})

include(cmake/xdgmime.cmake)

add_executable(encodingcheck encodingcheck.cpp)
target_link_libraries(encodingcheck PRIVATE libxdgmime is_utf8)
target_link_libraries(encodingcheck PRIVATE libxdgmime is_utf8::is_utf8)
25 changes: 25 additions & 0 deletions .github/workflows/encodingcheck/cmake/xdgmime.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
cmake_minimum_required(VERSION 3.17)
# project(xdgmime LANGUAGES C)

add_library(libxdgmime STATIC
${xdgmime_SOURCE_DIR}/src/xdgmime.c
${xdgmime_SOURCE_DIR}/src/xdgmimeglob.c
${xdgmime_SOURCE_DIR}/src/xdgmimeint.c
${xdgmime_SOURCE_DIR}/src/xdgmimemagic.c
${xdgmime_SOURCE_DIR}/src/xdgmimealias.c
${xdgmime_SOURCE_DIR}/src/xdgmimeparent.c
${xdgmime_SOURCE_DIR}/src/xdgmimecache.c
${xdgmime_SOURCE_DIR}/src/xdgmimeicon.c
)

add_executable(test-mime ${xdgmime_SOURCE_DIR}/src/test-mime.c)
target_link_libraries(test-mime PRIVATE libxdgmime)

add_executable(test-mime-data ${xdgmime_SOURCE_DIR}/src/test-mime-data.c)
target_link_libraries(test-mime-data PRIVATE libxdgmime)

add_executable(print-mime-data ${xdgmime_SOURCE_DIR}/src/print-mime-data.c)
target_link_libraries(print-mime-data PRIVATE libxdgmime)

target_include_directories(libxdgmime PUBLIC ${xdgmime_SOURCE_DIR}/src/)
target_compile_definitions(libxdgmime PRIVATE HAVE_MMAP)

This file was deleted.

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/encodingcheck/is_utf8/.github/workflows/vs17.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/encodingcheck/is_utf8/.gitignore

This file was deleted.

106 changes: 0 additions & 106 deletions .github/workflows/encodingcheck/is_utf8/CMakeLists.txt

This file was deleted.

Loading

0 comments on commit 39a78d4

Please sign in to comment.