Skip to content

Commit

Permalink
Fix ICU compilation on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
feliwir committed Sep 13, 2024
1 parent 0574116 commit 3a10c7b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ endif()
add_subdirectory(deps/baseconfig EXCLUDE_FROM_ALL)

if(ICU_FOUND)
target_link_libraries(base PRIVATE ICU::data ICU::i18n ICU::io ICU::tu ICU::uc)
target_compile_definitions(base PRIVATE -DBUILD_WITH_ICU)
endif()

Expand Down
2 changes: 1 addition & 1 deletion deps/baseconfig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ endif()

# We don't need to link anything if we have win32 threads. Affects MinGW builds primarily.
if(CMAKE_USE_PTHREADS_INIT AND NOT CMAKE_USE_WIN32_THREADS_INIT)
target_link_libraries(base Threads::Threads)
target_link_libraries(base PRIVATE Threads::Threads)
endif()

# Check for best macro that expands to current function name.
Expand Down
2 changes: 2 additions & 0 deletions deps/baseconfig/src/unichar.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
#ifndef BASE_UNICHAR_H
#define BASE_UNICHAR_H
#include <wchar.h>
#include <string.h>

#ifdef U_CHAR
#error U_CHAR has been defined before
#endif

#ifdef BUILD_WITH_ICU
#include <unicode/uchar.h>
#include <unicode/ustring.h>
typedef UChar unichar_t;
#define U_CHAR(str) (u##str)
#elif defined _WIN32
Expand Down

0 comments on commit 3a10c7b

Please sign in to comment.