Skip to content

Commit

Permalink
cmake: add option to use system mongoose installation (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
mochaaP authored Nov 13, 2023
1 parent 52888bd commit d2d4d03
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
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)

0 comments on commit d2d4d03

Please sign in to comment.