From 613bdb6c19454f420c828d3d43f702273e0fe936 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Tue, 13 Aug 2024 15:04:07 +0200 Subject: [PATCH] refactor(core): move utfcodec to common Refactor to support codecvt cleanup work in kmcmplib. --- {core/src => common/cpp}/utfcodec.cpp | 0 {core/src => common/include}/utfcodec.hpp | 0 core/doc/meson.build | 2 +- core/src/meson.build | 2 +- core/tests/meson.build | 5 ++++- core/tests/unit/utftest/meson.build | 2 +- 6 files changed, 7 insertions(+), 4 deletions(-) rename {core/src => common/cpp}/utfcodec.cpp (100%) rename {core/src => common/include}/utfcodec.hpp (100%) diff --git a/core/src/utfcodec.cpp b/common/cpp/utfcodec.cpp similarity index 100% rename from core/src/utfcodec.cpp rename to common/cpp/utfcodec.cpp diff --git a/core/src/utfcodec.hpp b/common/include/utfcodec.hpp similarity index 100% rename from core/src/utfcodec.hpp rename to common/include/utfcodec.hpp diff --git a/core/doc/meson.build b/core/doc/meson.build index 6039e2e2dd..a0f2bc4e6d 100644 --- a/core/doc/meson.build +++ b/core/doc/meson.build @@ -20,7 +20,7 @@ if hotdoc.found() deps = files( '../include/keyman/keyman_core_api.h', '../src/jsonpp.hpp', - '../src/utfcodec.hpp' + '../../common/cpp/utfcodec.hpp' ) docs = custom_target('docs', diff --git a/core/src/meson.build b/core/src/meson.build index 212b56f1c2..41c198543c 100644 --- a/core/src/meson.build +++ b/core/src/meson.build @@ -126,7 +126,7 @@ core_files = files( 'keyboard.cpp', 'state.cpp', 'jsonpp.cpp', - 'utfcodec.cpp', + '../../common/cpp/utfcodec.cpp', ) mock_files = files( diff --git a/core/tests/meson.build b/core/tests/meson.build index 84c17d4220..90e0ab2a54 100644 --- a/core/tests/meson.build +++ b/core/tests/meson.build @@ -10,7 +10,10 @@ cmpfiles = ['-c', 'import sys; a = open(sys.argv[1], \'r\').read(); b = open(sys.argv[2], \'r\').read(); exit(not (a==b))'] stnds = join_paths(meson.current_source_dir(), 'standards') -libsrc = include_directories(join_paths('../', 'src')) +libsrc = include_directories( + '../src', + '../../common/include' +) # kmx_test_source is required for linux builds, so always enable it even when we # disable all other tests diff --git a/core/tests/unit/utftest/meson.build b/core/tests/unit/utftest/meson.build index eff79c10b7..4ab6cb74ca 100644 --- a/core/tests/unit/utftest/meson.build +++ b/core/tests/unit/utftest/meson.build @@ -5,6 +5,6 @@ # e = executable('utftest', 'utftest.cpp', - objects: lib.extract_objects('utfcodec.cpp'), + objects: lib.extract_objects('../../common/cpp/utfcodec.cpp'), include_directories: [libsrc]) test('utftest', e)