Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: add option to use system mongoose installation #234

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ cmake_dependent_option(USE_SYSTEM_OPENCC "" OFF "NOT USE_SHARED_LIB" ON)
cmake_dependent_option(USE_SYSTEM_FMT "" OFF "NOT USE_SHARED_LIB" ON)
cmake_dependent_option(USE_SYSTEM_TINYXML2 "" OFF "NOT USE_SHARED_LIB" ON)
cmake_dependent_option(USE_SYSTEM_SDL2 "Only for PSV" OFF "PLATFORM_PSV" OFF)
cmake_dependent_option(USE_SYSTEM_MONGOOSE "" OFF "NOT USE_SHARED_LIB" ON)

option(DISABLE_OPENCC "Disable Chinese Simplified and Chinese Traditional Conversion " OFF)

Expand Down Expand Up @@ -293,4 +294,4 @@ endif ()
target_include_directories(${PROJECT_NAME} PRIVATE wiliwili/include wiliwili/include/api ${APP_PLATFORM_INCLUDE})
target_compile_options(${PROJECT_NAME} PRIVATE -ffunction-sections -fdata-sections -Wunused-variable ${APP_PLATFORM_OPTION})
target_link_libraries(${PROJECT_NAME} PRIVATE wiliwiliLibExtra borealis lunasvg pystring pdr mongoose z ${APP_PLATFORM_LIB})
target_link_options(${PROJECT_NAME} PRIVATE ${APP_PLATFORM_LINK_OPTION})
target_link_options(${PROJECT_NAME} PRIVATE ${APP_PLATFORM_LINK_OPTION})
10 changes: 8 additions & 2 deletions library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@ set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
add_subdirectory(lunasvg EXCLUDE_FROM_ALL)

# add mongoose
add_subdirectory(mongoose EXCLUDE_FROM_ALL)
if (USE_SYSTEM_MONGOOSE)
find_library(MONGOOSE_LIBRARY NAMES mongoose REQUIRED)
add_library(mongoose UNKNOWN IMPORTED)
set_property(TARGET mongoose PROPERTY IMPORTED_LOCATION ${MONGOOSE_LIBRARY})
else ()
add_subdirectory(mongoose EXCLUDE_FROM_ALL)
endif ()

# add borealis
add_subdirectory(borealis/library)
Expand All @@ -104,4 +110,4 @@ elseif (PLATFORM_PSV)
endif ()

add_library(wiliwiliLibExtra INTERFACE)
target_link_libraries(wiliwiliLibExtra INTERFACE cpr::cpr qrcode)
target_link_libraries(wiliwiliLibExtra INTERFACE cpr::cpr qrcode)