Skip to content

Commit 96d64d4

Browse files
committed
CMake cleanup
1 parent 8fa0e73 commit 96d64d4

File tree

7 files changed

+2401
-2427
lines changed

7 files changed

+2401
-2427
lines changed

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ if(${Python3_Interpreter_FOUND})
3636
file(GLOB UNICODE_SCRIPTS ${CMAKE_CURRENT_LIST_DIR}/unicode/scripts/*.py)
3737

3838
set(UNICODE_GENERATED_FILES
39-
${CMAKE_CURRENT_LIST_DIR}/lib/inc/sys_string/impl/unicode/mappings_data.h
4039
${CMAKE_CURRENT_LIST_DIR}/lib/inc/sys_string/impl/unicode/mappings.h
4140
${CMAKE_CURRENT_LIST_DIR}/test/test_grapheme_data.h
4241
${CMAKE_CURRENT_LIST_DIR}/test/test_grapheme_data_15.h
@@ -59,6 +58,13 @@ if(${Python3_Interpreter_FOUND})
5958
${UNICODE_GENERATED_FILES}
6059
)
6160

61+
target_sources(generate_unicode_mappings
62+
PRIVATE
63+
${UNICODE_SCRIPTS}
64+
)
65+
66+
set_source_files_properties(${UNICODE_SCRIPTS} PROPERTIES XCODE_EXPLICIT_FILE_TYPE text.script.python)
67+
6268
add_dependencies(sys_string generate_unicode_mappings)
6369

6470
endif()

lib/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ set(UNICODE_FILES
5656
${SRCDIR}/inc/sys_string/impl/unicode/algorithms.h
5757
${SRCDIR}/inc/sys_string/impl/unicode/mappings_common.h
5858
${SRCDIR}/inc/sys_string/impl/unicode/mappings.h
59-
${SRCDIR}/inc/sys_string/impl/unicode/mappings_data.h
6059
${SRCDIR}/inc/sys_string/impl/unicode/mappings_icu.h
6160
)
6261
source_group("Unicode" FILES ${UNICODE_FILES} ${SOURCES})

lib/inc/sys_string/impl/unicode/algorithms.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <sys_string/impl/unicode/mappings_icu.h>
1313
#else
1414
#include <sys_string/impl/unicode/mappings.h>
15-
#include <sys_string/impl/unicode/mappings_data.h>
1615
#endif
1716
#include <sys_string/impl/unicode/utf_util.h>
1817
#include <sys_string/impl/util/iter_util.h>

lib/inc/sys_string/impl/unicode/mappings.h

Lines changed: 2388 additions & 0 deletions
Large diffs are not rendered by default.

lib/inc/sys_string/impl/unicode/mappings_data.h

Lines changed: 0 additions & 2401 deletions
This file was deleted.

unicode/scripts/genmappings.py

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
parser = argparse.ArgumentParser()
1919

2020
parser.add_argument('datadir')
21-
parser.add_argument('implfile')
2221
parser.add_argument('hfile')
2322
parser.add_argument('test_grapheme_data_h')
2423
parser.add_argument('test_grapheme_data_15_h')
@@ -27,7 +26,6 @@
2726
args = parser.parse_args()
2827

2928
datadir = Path(args.datadir)
30-
implfile = Path(args.implfile)
3129
hfile = Path(args.hfile)
3230
testfiles = (
3331
Path(args.test_grapheme_data_h),
@@ -328,25 +326,7 @@ def main():
328326
print_enum((grapheme_cluster_break_prop_values, grapheme_related_emoji_values, grapheme_related_prop_values),
329327
grapheme_masks)),
330328
4)}
331-
}}
332-
333-
#endif
334-
335-
''')
336-
337-
338-
write_file(implfile, f'''//THIS FILE IS GENERATED. PLEASE DO NOT EDIT DIRECTLY
339-
340-
//
341-
// Copyright 2020 Eugene Gershnik
342-
//
343-
// Use of this source code is governed by a BSD-style
344-
// license that can be found in the LICENSE file or at
345-
// https://github.com/gershnik/sys_string/blob/master/LICENSE
346-
//
347329
348-
namespace sysstr::util::unicode
349-
{{
350330
351331
{indent_insert(whitespaces.print_impl('is_whitespace'), 4)}
352332
{indent_insert(case_info_builder.print_impl(), 4)}
@@ -359,9 +339,11 @@ def main():
359339
normalizer::data_size +
360340
grapheme_cluster_break_prop::data_size;
361341
static_assert(total_data_size == {total_data_size});
362-
363342
}}
364-
''')
343+
344+
#endif
345+
346+
''')
365347

366348
for testfile, tests in zip(testfiles[:2], test_cases[:2]):
367349
write_file(testfile, f'''

unicode/scripts/norm_builder.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,4 +401,5 @@ def print_impl(self):
401401
402402
{indent_insert(self.__decomp_builder.print_impl("normalizer::lookup"), 8)}
403403
'''
404-
return dedent(ret)
404+
return dedent(ret)
405+

0 commit comments

Comments
 (0)