Skip to content

Commit

Permalink
Add utfcpp submdule
Browse files Browse the repository at this point in the history
  • Loading branch information
adazem009 committed Feb 24, 2024
1 parent eaa66ea commit 73aab33
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "thirdparty/googletest"]
path = thirdparty/googletest
url = https://github.com/google/googletest
[submodule "thirdparty/utfcpp"]
path = thirdparty/utfcpp
url = https://github.com/nemtrif/utfcpp
9 changes: 4 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ project(libscratchcpp LANGUAGES C CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(ZIP_SRC thirdparty/zip/src)

option(LIBSCRATCHCPP_BUILD_UNIT_TESTS "Build unit tests" ON)
option(LIBSCRATCHCPP_NETWORK_SUPPORT "Support for downloading projects" ON)
Expand All @@ -16,8 +15,6 @@ if (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
set(LIBSCRATCHCPP_COMPUTED_GOTO OFF CACHE BOOL "" FORCE)
endif()

find_package(utf8cpp REQUIRED)

add_library(scratchcpp SHARED)
add_subdirectory(src)
include_directories(src) # TODO: Remove this line
Expand Down Expand Up @@ -66,21 +63,23 @@ target_sources(scratchcpp
)

include(FetchContent)
set(ZIP_SRC thirdparty/zip/src)
set(UTFCPP_SRC thirdparty/utfcpp/source)

add_library(zip SHARED
${ZIP_SRC}/zip.c
${ZIP_SRC}/zip.h
${ZIP_SRC}/miniz.h
)
include_directories(thirdparty/zip/src)
target_include_directories(scratchcpp PUBLIC ${ZIP_SRC})

target_include_directories(scratchcpp PUBLIC ${UTFCPP_SRC})
include_directories(thirdparty/spimpl)

FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
FetchContent_MakeAvailable(json)

target_link_libraries(scratchcpp PRIVATE nlohmann_json::nlohmann_json)
target_link_libraries(scratchcpp PRIVATE utf8cpp)
target_link_libraries(scratchcpp PRIVATE zip)
target_link_libraries(scratchcpp PRIVATE scratchcpp-audio)

Expand Down
1 change: 1 addition & 0 deletions thirdparty/utfcpp
Submodule utfcpp added at 6be08b

0 comments on commit 73aab33

Please sign in to comment.