Skip to content

Commit

Permalink
Fix MacOS again
Browse files Browse the repository at this point in the history
  • Loading branch information
fdr400 committed Jan 6, 2025
1 parent 749b7ba commit 305e1f9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cmake/modules/Findlibzip.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ _userver_module_find_include(
)

_userver_module_find_library(
NAMES bz2 libbz2
NAMES libbz2.a bz2 libbz2
PATH_SUFFIXES lib
)

Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/Findlibzstd.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ _userver_module_find_library(

_userver_module_end()

if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
if(CMAKE_SYSTEM_NAME MATCHES "Darwin" AND NOT TARGET zstd)
add_library(zstd ALIAS libzstd)
endif()
20 changes: 12 additions & 8 deletions universal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,6 @@ if (USERVER_SANITIZE AND NOT CMAKE_BUILD_TYPE MATCHES "^Rel")
target_link_libraries(${PROJECT_NAME} PUBLIC userver-compiler-rt-parts)
endif()

find_package(ICU COMPONENTS uc i18n data REQUIRED)
add_library(icuuc ALIAS ICU::uc)
add_library(icui18n ALIAS ICU::i18n)
add_library(icudata ALIAS ICU::data)

target_link_libraries(${PROJECT_NAME}
PUBLIC
Threads::Threads
Expand All @@ -242,9 +237,6 @@ target_link_libraries(${PROJECT_NAME}
Boost::regex
OpenSSL::Crypto
OpenSSL::SSL
ICU::uc
ICU::i18n
ICU::data
)

if (USERVER_CONAN)
Expand Down Expand Up @@ -280,6 +272,18 @@ else()
libzstd
CryptoPP
)

find_package(ICU COMPONENTS uc i18n data REQUIRED)
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
set_target_properties(ICU::uc PROPERTIES IMPORTED_GLOBAL TRUE)
set_target_properties(ICU::i18n PROPERTIES IMPORTED_GLOBAL TRUE)
set_target_properties(ICU::data PROPERTIES IMPORTED_GLOBAL TRUE)
endif()
add_library(icuuc ALIAS ICU::uc)
add_library(icui18n ALIAS ICU::i18n)
add_library(icudata ALIAS ICU::data)

target_link_libraries(${PROJECT_NAME} PRIVATE ICU::uc ICU::i18n ICU::data)
endif()

if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
Expand Down

0 comments on commit 305e1f9

Please sign in to comment.