diff --git a/3party/freetype/CMakeLists.txt b/3party/freetype/CMakeLists.txt index cd8d17ad7..f1e5950b3 100644 --- a/3party/freetype/CMakeLists.txt +++ b/3party/freetype/CMakeLists.txt @@ -4,7 +4,9 @@ set(FT_DISABLE_HARFBUZZ ON) add_subdirectory(freetype) # Fix warning with ONE_PIXEL macro clash. -target_compile_options(freetype PRIVATE -Wno-macro-redefined) +if(NOT MSVC) + target_compile_options(freetype PRIVATE -Wno-macro-redefined) +endif() # Use ft2build.h from the current directory instead of the default. target_include_directories(freetype diff --git a/3party/harfbuzz/CMakeLists.txt b/3party/harfbuzz/CMakeLists.txt index d7041d46b..871e34359 100644 --- a/3party/harfbuzz/CMakeLists.txt +++ b/3party/harfbuzz/CMakeLists.txt @@ -11,14 +11,23 @@ target_include_directories(${PROJECT_NAME} harfbuzz/src ) -# Keep these settigns in sync with xcode/harfbuzz project. -target_compile_options(${PROJECT_NAME} - PRIVATE - -fno-rtti - -fno-exceptions - -fno-threadsafe-statics - $<$,$>:-Wno-format-pedantic> -) +if (MSVC) + target_compile_options(${PROJECT_NAME} + PRIVATE + /GR- + /EHsc- + /Zc:threadSafeInit- + ) +else() + # Keep these settings in sync with xcode/harfbuzz project. + target_compile_options(${PROJECT_NAME} + PRIVATE + -fno-rtti + -fno-exceptions + -fno-threadsafe-statics + $<$,$>:-Wno-format-pedantic> + ) +endif() target_compile_definitions(${PROJECT_NAME} PRIVATE @@ -28,14 +37,20 @@ target_compile_definitions(${PROJECT_NAME} #$<$:HAVE_CORETEXT> HAVE_ATEXIT HAVE_GETPAGESIZE - HAVE_MMAP HAVE_MPROTECT - HAVE_PTHREAD HAVE_SYSCONF - HAVE_SYS_MMAN_H - HAVE_UNISTD_H ) +if (NOT MSVC) + target_compile_definitions(${PROJECT_NAME} + PRIVATE + HAVE_MMAP + HAVE_PTHREAD + HAVE_SYS_MMAN_H + HAVE_UNISTD_H + ) +endif() + target_link_libraries(${PROJECT_NAME} Freetype::Freetype) add_library(harfbuzz::harfbuzz ALIAS harfbuzz) diff --git a/3party/icu/CMakeLists.txt b/3party/icu/CMakeLists.txt index 0258c86dc..7b8df431b 100644 --- a/3party/icu/CMakeLists.txt +++ b/3party/icu/CMakeLists.txt @@ -172,6 +172,7 @@ add_library(icuuc icu/icu4c/source/common/uvector.cpp icu/icu4c/source/common/uvectr32.cpp icu/icu4c/source/common/uvectr64.h + icu/icu4c/source/common/wintz.cpp icu/icu4c/source/common/wintz.h ) diff --git a/3party/protobuf/CMakeLists.txt b/3party/protobuf/CMakeLists.txt index 58e6a1d0b..850776731 100644 --- a/3party/protobuf/CMakeLists.txt +++ b/3party/protobuf/CMakeLists.txt @@ -11,6 +11,7 @@ set(SRC protobuf/src/google/protobuf/message_lite.cc protobuf/src/google/protobuf/repeated_field.cc protobuf/src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc + protobuf/src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc protobuf/src/google/protobuf/stubs/bytestream.cc protobuf/src/google/protobuf/stubs/common.cc protobuf/src/google/protobuf/stubs/int128.cc diff --git a/CMakeLists.txt b/CMakeLists.txt index 85e0b6828..ab4f0b54d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,7 +197,7 @@ if (USE_PCH) endif() # Should be on the root level, not in 3party, so tests can get these dependencies. -if (PLATFORM_LINUX OR PLATFORM_WIN) +if (PLATFORM_LINUX) find_package(ICU COMPONENTS uc i18n data REQUIRED) find_package(Freetype REQUIRED) find_package(harfbuzz REQUIRED) diff --git a/libs/base/CMakeLists.txt b/libs/base/CMakeLists.txt index 493b83e8a..cd36429ce 100644 --- a/libs/base/CMakeLists.txt +++ b/libs/base/CMakeLists.txt @@ -108,7 +108,9 @@ omim_add_library(${PROJECT_NAME} ${SRC}) # Exception for some of our math to work reliably. # Ubuntu x86_64 gcc 14.2.0 ignores -fno-finite-math-only in debug builds without -O1 -set_source_files_properties(fast_math.cpp PROPERTIES COMPILE_OPTIONS "-fno-finite-math-only;$<$:-O1>") +if (NOT MSVC) + set_source_files_properties(fast_math.cpp PROPERTIES COMPILE_OPTIONS "-fno-finite-math-only;$<$:-O1>") +endif() set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) diff --git a/libs/platform/CMakeLists.txt b/libs/platform/CMakeLists.txt index 7282d9bac..f87b1a7c6 100644 --- a/libs/platform/CMakeLists.txt +++ b/libs/platform/CMakeLists.txt @@ -94,7 +94,7 @@ elseif(${PLATFORM_ANDROID}) ) else() # neither iPhone nor Android # Find bash first, on Windows it can be either in Git or in WSL - find_program(BASH bash REQUIRED) + find_program(BASH bash REQUIRED HINTS "$ENV{ProgramFiles}/Git/bin") # Generate version header file. execute_process(COMMAND "${BASH}" tools/unix/version.sh qt_version WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}