Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions .github/workflows/build-cmake.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand All @@ -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' }}
Expand Down
17 changes: 17 additions & 0 deletions 3party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions 3party/protobuf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
$<$<CXX_COMPILER_ID:AppleClang,Clang>:-Wno-shorten-64-to-32>
$<$<CXX_COMPILER_ID:AppleClang,Clang,GNU>:-Wno-deprecated-declarations>
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<$<CXX_COMPILER_ID:GNU>:-Wno-psabi>)
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 2 additions & 0 deletions dev_sandbox/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class TestDescriptionSectionBuilder
static int SumPageSizes(std::vector<PageT> 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<int>(p.second.size()); });
}

static bool CheckLangs(DescriptionsCollectionBuilderStat::LangStatistics const & stat)
Expand Down
1 change: 0 additions & 1 deletion libs/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ set(SRC
../std/windows.hpp
array_adapters.hpp
assert.hpp
atomic_shared_ptr.hpp
base.cpp
base.hpp
beam.hpp
Expand Down
27 changes: 0 additions & 27 deletions libs/base/atomic_shared_ptr.hpp

This file was deleted.

10 changes: 5 additions & 5 deletions libs/base/base_tests/beam_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ using namespace std;
template <template <typename, typename> class Beam>
void Smoke()
{
size_t const kCapacity = 10;
size_t const kTotal = 100;
constexpr size_t kCapacity = 10;
constexpr size_t kTotal = 100;

CHECK_LESS_OR_EQUAL(kCapacity, kTotal, ());
static_assert(kCapacity <= kTotal);

Beam<uint32_t, double> beam(kCapacity);

for (uint32_t i = 0; i < kTotal; ++i)
for (size_t i = 0; i < kTotal; ++i)
beam.Add(i, static_cast<double>(i));

vector<double> expected;
for (size_t i = 0; i < kCapacity; ++i)
expected.emplace_back(kTotal - 1 - i);
expected.emplace_back(static_cast<double>(kTotal - 1 - i));

vector<double> actual;
actual.reserve(kCapacity);
Expand Down
2 changes: 1 addition & 1 deletion libs/coding/coding_tests/fixed_bits_ddvector_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void TestWithData(vector<uint32_t> const & lst)
builder.PushBack(v);
}

pair<uint32_t, uint32_t> expected(optCount, lst.size());
pair<uint32_t, uint32_t> expected(optCount, static_cast<uint32_t>(lst.size()));
TEST_EQUAL(builder.GetCount(), expected, ());
}

Expand Down
4 changes: 2 additions & 2 deletions libs/coding/string_utf8_multilang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ constexpr bool IsServiceLang(std::string_view const lang)
lang == kLanguages[StringUtf8Multilang::kOldNameCode].m_code;
}

StringUtf8Multilang::Languages constexpr allLanguages = [] consteval
StringUtf8Multilang::Languages const allLanguages = []
{
StringUtf8Multilang::Languages langs;
std::ranges::copy_if(kLanguages, std::back_inserter(langs), [](StringUtf8Multilang::Lang const & lang)
{ return lang.m_code != StringUtf8Multilang::kReservedLang; });
return langs;
}();

StringUtf8Multilang::Languages constexpr languagesWithoutService = [] consteval
StringUtf8Multilang::Languages const languagesWithoutService = []
{
StringUtf8Multilang::Languages langs;
std::ranges::copy_if(allLanguages, std::back_inserter(langs),
Expand Down
2 changes: 1 addition & 1 deletion libs/coding/zlib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <cstddef>
#include <string>

#include "zlib.h"
#include <zlib.h>

namespace coding
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ DescriptionsCollection Convert(std::vector<RawDescription> const & rawDescriptio

for (auto const & translation : desc.m_strings)
{
ftDesc.m_strIndices.emplace_back(translation.first, descriptions.m_strings.size());
ftDesc.m_strIndices.emplace_back(translation.first, static_cast<uint32_t>(descriptions.m_strings.size()));
descriptions.m_strings.push_back(translation.second);
}
}
Expand Down
2 changes: 1 addition & 1 deletion libs/drape/batcher_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ void TriangleFanBatch::BatchData(ref_ptr<GraphicsContext> context, ref_ptr<Attri
// "(vertexCount + 1) - batchVertexCount" we allocate CPUBuffer on all remaining data
// + first vertex of fan, that must be duplicate in the next buffer
// + last vertex of currently uploaded data.
cpuBuffers.emplace_back(binding.GetElementSize(), (vertexCount + 2) - batchVertexCount);
cpuBuffers.emplace_back(static_cast<uint8_t>(binding.GetElementSize()), (vertexCount + 2) - batchVertexCount);
CPUBuffer & cpuBuffer = cpuBuffers.back();
cpuBuffer.UploadData(rawDataPointer, 1);

Expand Down
4 changes: 2 additions & 2 deletions libs/drape/gl_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ void GLFunctions::glVertexAttributePointer(int attrLocation, uint32_t count, glC
ASSERT_EQUAL(CurrentApiVersion, dp::ApiVersion::OpenGLES3, ());
ASSERT(glVertexAttributePointerFn != nullptr, ());
GLCHECK(glVertexAttributePointerFn(attrLocation, count, type, convert(needNormalize), stride,
reinterpret_cast<void *>(offset)));
reinterpret_cast<GLvoid const *>(static_cast<GLintptr>(offset))));
}

void GLFunctions::glGetActiveUniform(uint32_t programID, uint32_t uniformIndex, int32_t * uniformSize, glConst * type,
Expand Down Expand Up @@ -1048,7 +1048,7 @@ void GLFunctions::glDrawElements(glConst primitive, uint32_t sizeOfIndex, uint32
{
ASSERT_EQUAL(CurrentApiVersion, dp::ApiVersion::OpenGLES3, ());
GLCHECK(::glDrawElements(primitive, indexCount, sizeOfIndex == sizeof(uint32_t) ? GL_UNSIGNED_INT : GL_UNSIGNED_SHORT,
reinterpret_cast<GLvoid *>(startIndex * sizeOfIndex)));
reinterpret_cast<GLvoid const *>(static_cast<GLintptr>(startIndex * sizeOfIndex))));
}

void GLFunctions::glDrawArrays(glConst mode, int32_t first, uint32_t count)
Expand Down
22 changes: 11 additions & 11 deletions libs/drape/harfbuzz_shaping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ using TScriptsArray = std::array<UScriptCode, 32>;

// Writes the script and the script extensions of the Unicode codepoint.
// Returns the number of written scripts.
size_t GetScriptExtensions(char32_t codepoint, TScriptsArray & scripts)
int32_t GetScriptExtensions(char32_t codepoint, TScriptsArray & scripts)
{
// Fill scripts with the script extensions.
UErrorCode icu_error = U_ZERO_ERROR;
size_t const count = uscript_getScriptExtensions(static_cast<UChar32>(codepoint), scripts.data(),
int32_t const count = uscript_getScriptExtensions(static_cast<UChar32>(codepoint), scripts.data(),
static_cast<int32_t>(scripts.max_size()), &icu_error);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[clang-format] reported by reviewdog 🐶

Suggested change
static_cast<int32_t>(scripts.max_size()), &icu_error);
static_cast<int32_t>(scripts.max_size()), &icu_error);

if (U_FAILURE(icu_error))
{
Expand All @@ -38,7 +38,7 @@ size_t GetScriptExtensions(char32_t codepoint, TScriptsArray & scripts)

// Intersects the script extensions set of codepoint with scripts and returns the updated size of the scripts.
// The output result will be a subset of the input result (thus resultSize can only be smaller).
size_t ScriptSetIntersect(char32_t codepoint, TScriptsArray & inOutScripts, size_t inOutScriptsCount)
int32_t ScriptSetIntersect(char32_t codepoint, TScriptsArray & inOutScripts, int32_t inOutScriptsCount)
{
// Each codepoint has a Script property and a Script Extensions (Scx) property.
//
Expand All @@ -65,7 +65,7 @@ size_t ScriptSetIntersect(char32_t codepoint, TScriptsArray & inOutScripts, size
// For most of the codepoints, the script extensions set contains only one element. For CJK codepoints, it's common
// to see 3-4 scripts. For really rare cases, the set can go above 20 scripts.
TScriptsArray codepointScripts;
size_t const codepointScriptsCount = GetScriptExtensions(codepoint, codepointScripts);
size_t const codepointScriptsCount = static_cast<size_t>(GetScriptExtensions(codepoint, codepointScripts));

// Implicit script 'inherited' is inheriting scripts from preceding codepoint.
if (codepointScriptsCount == 1 && codepointScripts[0] == USCRIPT_INHERITED)
Expand Down Expand Up @@ -99,27 +99,27 @@ size_t ScriptSetIntersect(char32_t codepoint, TScriptsArray & inOutScripts, size
//
// Consider 3 characters with the script values {Kana}, {Hira, Kana}, {Kana}. Without script extensions only the first
// script in each set would be taken into account, resulting in 3 segments where 1 would be enough.
size_t ScriptInterval(std::u16string const & text, int32_t start, size_t length, UScriptCode & outScript)
int32_t ScriptInterval(std::u16string const & text, int32_t start, int32_t length, UScriptCode & outScript)
{
ASSERT_GREATER(length, 0U, ());

auto const begin = text.begin() + start;
auto const end = text.begin() + start + static_cast<int32_t>(length);
auto const end = text.begin() + start + length;
auto iterator = begin;

auto c32 = utf8::unchecked::next16(iterator);

TScriptsArray scripts;
size_t scriptsSize = GetScriptExtensions(c32, scripts);
int32_t scriptsSize = GetScriptExtensions(c32, scripts);

while (iterator != end)
{
auto prev = iterator;
c32 = utf8::unchecked::next16(iterator);
scriptsSize = ScriptSetIntersect(c32, scripts, scriptsSize);
if (scriptsSize == 0U)
if (scriptsSize == 0)
{
length = prev - begin;
length = static_cast<int32_t>(prev - begin);
break;
}
}
Expand Down Expand Up @@ -168,7 +168,7 @@ void GetSingleTextLineRuns(TextSegments & segments)
{
// Find the longest sequence of characters that have at least one common UScriptCode value.
UScriptCode script = USCRIPT_INVALID_CODE;
size_t const scriptRunEnd =
int32_t const scriptRunEnd =
ScriptInterval(segments.m_text, scriptRunStart, bidiRunEnd - scriptRunStart, script) + scriptRunStart;
ASSERT_LESS(scriptRunStart, base::asserted_cast<int32_t>(scriptRunEnd), ());

Expand All @@ -179,7 +179,7 @@ void GetSingleTextLineRuns(TextSegments & segments)
bidiLevel & 0x01 ? HB_DIRECTION_RTL : HB_DIRECTION_LTR);

// Move to the next script sequence.
scriptRunStart = static_cast<int32_t>(scriptRunEnd);
scriptRunStart = scriptRunEnd;
}
// Move to the next direction sequence.
bidiRunStart = bidiRunEnd;
Expand Down
2 changes: 1 addition & 1 deletion libs/drape_frontend/drape_measurer.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "drape/drape_diagnostics.hpp"
#include "drape/drape_global.hpp"
#include "drape/utils/glyph_usage_tracker.hpp"
#include "drape/utils/gpu_mem_tracker.hpp"

Expand All @@ -10,7 +11,6 @@
#include "base/timer.hpp"

#include <chrono>
#include <drape/drape_global.hpp>
#include <map>
#include <memory>
#include <mutex>
Expand Down
4 changes: 2 additions & 2 deletions libs/editor/config_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void Waiter::Interrupt()
m_event.notify_all();
}

ConfigLoader::ConfigLoader(base::AtomicSharedPtr<EditorConfig> & config) : m_config(config)
ConfigLoader::ConfigLoader(std::atomic<std::shared_ptr<EditorConfig>> & config) : m_config(config)
{
pugi::xml_document doc;
LoadFromLocal(doc);
Expand All @@ -47,7 +47,7 @@ void ConfigLoader::ResetConfig(pugi::xml_document const & doc)
{
auto config = std::make_shared<EditorConfig>();
config->SetConfig(doc);
m_config.Set(config);
m_config.store(config);
}

// static
Expand Down
Loading
Loading