diff --git a/.github/workflows/build-cmake.yaml b/.github/workflows/build-cmake.yaml index 3fc15c22b6e..e3ce377818f 100644 --- a/.github/workflows/build-cmake.yaml +++ b/.github/workflows/build-cmake.yaml @@ -59,6 +59,11 @@ jobs: cc: clang cxx: clang++ developer-dir: /Applications/Xcode_26.2.app/Contents/Developer + + - os: windows-2025-vs2026 + cc: cl.exe + cxx: cl.exe + exclude: - environment: { unity: OFF } cmake-build-type: Release @@ -118,15 +123,37 @@ jobs: brew install ninja qt@6 pip3 install tornado --break-system-packages + - name: Install Qt + if: ${{ runner.os == 'Windows' }} + uses: jurplel/install-qt-action@v4 + - name: Configure repository + if: ${{ runner.os != 'Windows' }} + shell: bash run: ./configure.sh + - uses: ilammy/msvc-dev-cmd@v1 + if: ${{ runner.os == 'Windows' }} + + - name: Bootstrap boost (Windows) + if: ${{ runner.os == 'Windows' }} + shell: cmd + run: .\bootstrap.bat msvc + working-directory: ./3party/boost + + - name: Install boost (Windows) + if: ${{ runner.os == 'Windows' }} + shell: cmd + run: .\b2.exe headers + working-directory: ./3party/boost + - name: Configure ccache uses: hendrikmuhs/ccache-action@v1.2 with: key: ${{ github.workflow }}-${{ matrix.environment.os }}-${{ matrix.environment.cc }}-${{ matrix.environment.unity }}-${{ matrix.cmake-build-type }} - name: Configure cmake + shell: bash env: CC: ${{ matrix.environment.cc }} CXX: ${{ matrix.environment.cxx }} @@ -136,13 +163,12 @@ jobs: run: | cmake . -B ${{ env.BUILD_DIR }} -G Ninja \ -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} \ - -DCMAKE_C_FLAGS=-g1 \ - -DCMAKE_CXX_FLAGS=-g1 \ -DCMAKE_UNITY_BUILD=${UNITY_BUILD} - name: Compile + shell: bash working-directory: ${{ env.BUILD_DIR }} - run: ninja + run: cmake --build . - name: Prepare testing environment (Linux) if: ${{ runner.os == 'Linux' }} diff --git a/3party/CMakeLists.txt b/3party/CMakeLists.txt index e90e6251b2e..9f7aa6fd4a5 100644 --- a/3party/CMakeLists.txt +++ b/3party/CMakeLists.txt @@ -35,6 +35,9 @@ if (NOT WITH_SYSTEM_PROVIDED_3PARTY) set(JANSSON_WITHOUT_TESTS ON) add_subdirectory(jansson/jansson/) target_include_directories(jansson INTERFACE "${PROJECT_BINARY_DIR}/3party/jansson/jansson/include") + if (PLATFORM_WIN) + set_target_properties(jansson PROPERTIES UNITY_BUILD OFF) + endif() # Add gflags library. set(GFLAGS_BUILD_TESTING OFF) @@ -57,6 +60,20 @@ if (NOT WITH_SYSTEM_PROVIDED_3PARTY) add_library(utf8cpp INTERFACE) add_library(utf8cpp::utf8cpp ALIAS utf8cpp) target_include_directories(utf8cpp INTERFACE "${OMIM_ROOT}/3party/utfcpp/source") + + set(ZLIB_COMPAT ON) + set(ZLIB_ENABLE_TESTS OFF) + set(ZLIB_ALIASES OFF) + set(SKIP_INSTALL_ALL ON) + include(FetchContent) + FetchContent_Declare( + zlib-ng + GIT_REPOSITORY https://github.com/zlib-ng/zlib-ng.git + GIT_TAG 2.3.2 + ) + FetchContent_MakeAvailable(zlib-ng) + add_library(ZLIB::ZLIB ALIAS zlib-ng) + set_target_properties(zlib-ng PROPERTIES UNITY_BUILD OFF) endif() add_subdirectory(agg) diff --git a/3party/protobuf/CMakeLists.txt b/3party/protobuf/CMakeLists.txt index 8507767315a..7f491bd1435 100644 --- a/3party/protobuf/CMakeLists.txt +++ b/3party/protobuf/CMakeLists.txt @@ -37,6 +37,10 @@ if(NOT PLATFORM_WIN) target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_PTHREAD) endif () +if(PLATFORM_WIN) + set_target_properties(${PROJECT_NAME} PROPERTIES UNITY_BUILD OFF) +endif() + target_compile_options(${PROJECT_NAME} PRIVATE $<$:-Wno-shorten-64-to-32> $<$:-Wno-deprecated-declarations> diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d9128ce6c9..2f58597335a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,7 +77,8 @@ endif() # Global compile options for all configurations. if (MSVC) - add_compile_options(/utf-8) + add_compile_options(/utf-8 /bigobj) + add_compile_options(/fp:fast) add_link_options(/INCREMENTAL:NO) else() add_compile_options(-ffast-math $<$:-Wno-psabi>) @@ -187,10 +188,9 @@ if (WITH_SYSTEM_PROVIDED_3PARTY) find_package(jansson CONFIG REQUIRED) find_package(pugixml REQUIRED) find_package(utf8cpp REQUIRED) + find_package(ZLIB REQUIRED) endif() -find_package(ZLIB REQUIRED) - # Include 3party dependencies. add_subdirectory(3party) diff --git a/dev_sandbox/main.cpp b/dev_sandbox/main.cpp index 7d876e2d12c..e9d7644dd41 100644 --- a/dev_sandbox/main.cpp +++ b/dev_sandbox/main.cpp @@ -260,8 +260,10 @@ int main(int argc, char * argv[]) if (!settings::Get(settings::kDeveloperMode, outvalue)) settings::Set(settings::kDeveloperMode, true); +#if !defined(OMIM_OS_WINDOWS) if (!FLAGS_lang.empty()) (void)::setenv("LANGUAGE", FLAGS_lang.c_str(), 1); +#endif FrameworkParams frameworkParams; Framework framework(frameworkParams); diff --git a/generator/generator_tests/descriptions_section_builder_tests.cpp b/generator/generator_tests/descriptions_section_builder_tests.cpp index b726854b19a..7c2499247af 100644 --- a/generator/generator_tests/descriptions_section_builder_tests.cpp +++ b/generator/generator_tests/descriptions_section_builder_tests.cpp @@ -231,7 +231,7 @@ class TestDescriptionSectionBuilder static int SumPageSizes(std::vector const & p) { return std::accumulate(std::begin(p), std::end(p), 0, - [](int acc, PageT const & p) { return acc + p.second.size(); }); + [](int acc, PageT const & p) { return acc + static_cast(p.second.size()); }); } static bool CheckLangs(DescriptionsCollectionBuilderStat::LangStatistics const & stat) diff --git a/libs/base/CMakeLists.txt b/libs/base/CMakeLists.txt index e9bc68411f9..d6042848ddd 100644 --- a/libs/base/CMakeLists.txt +++ b/libs/base/CMakeLists.txt @@ -9,7 +9,6 @@ set(SRC ../std/windows.hpp array_adapters.hpp assert.hpp - atomic_shared_ptr.hpp base.cpp base.hpp beam.hpp diff --git a/libs/base/atomic_shared_ptr.hpp b/libs/base/atomic_shared_ptr.hpp deleted file mode 100644 index 3059f0dc09d..00000000000 --- a/libs/base/atomic_shared_ptr.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#include "base/macros.hpp" - -#include - -namespace base -{ -// Template which provides methods for concurrently using shared pointers. -template -class AtomicSharedPtr final -{ -public: - using ContentType = T const; - using ValueType = std::shared_ptr; - - AtomicSharedPtr() = default; - - void Set(ValueType value) noexcept { atomic_store(&m_wrapped, value); } - ValueType Get() const noexcept { return atomic_load(&m_wrapped); } - -private: - ValueType m_wrapped = std::make_shared(); - - DISALLOW_COPY_AND_MOVE(AtomicSharedPtr); -}; -} // namespace base diff --git a/libs/base/base_tests/beam_tests.cpp b/libs/base/base_tests/beam_tests.cpp index cd67823f318..0b8e26085b2 100644 --- a/libs/base/base_tests/beam_tests.cpp +++ b/libs/base/base_tests/beam_tests.cpp @@ -20,19 +20,19 @@ using namespace std; template