17 Commits

Author SHA1 Message Date
5287bed5f5 Merge branch 'master' of github.com:-1mhu/gds-render
All checks were successful
CMake / build (push) Successful in 37s
2025-07-27 19:09:46 +02:00
560f217e26 Update .github/workflows/cmake.yml
All checks were successful
CMake / build (push) Successful in 35s
2025-07-27 19:02:15 +02:00
2000a45e18 Update .github/workflows/cmake.yml
Some checks failed
CMake / build (push) Failing after 30s
2025-07-27 19:00:04 +02:00
1a390efc85 Update .github/workflows/cmake.yml
Some checks failed
CMake / build (push) Failing after 27s
2025-07-27 18:58:50 +02:00
22c551750f Update .github/workflows/cmake.yml
Some checks failed
CMake / build (push) Failing after 1m21s
Test workflow on gitea
2025-07-27 18:56:40 +02:00
c9b0783a07 Exclude libfort from installation 2025-05-10 23:21:28 +02:00
f88c1d4bdf Update deprecated GTK code 2025-05-10 23:13:16 +02:00
4193fd40c1 Update Cmake versions 2025-05-10 23:11:10 +02:00
03216a4a86 Update cmake.yml 2024-06-16 20:26:32 +02:00
504dc476b1 Fix recursive clone in github actions 2022-12-17 19:00:16 +01:00
8ff872cf36 Fix recursive clone in github actions 2022-12-17 18:57:19 +01:00
9c4dbd51c8 Merge branch 'dev' 2022-12-17 18:52:05 +01:00
2829143bbe Merge pull request 'Fix #49: Initialize variable' (#50) from fix-issue-49 into dev
Reviewed-on: #50
2022-12-17 18:43:56 +01:00
5185097075 Fix #49: Initialize variable 2022-12-17 18:43:10 +01:00
573cd59892 Merge branch 'dev' 2022-04-17 22:21:38 +02:00
8b1f667819 Merge pull request 'issue/47-add-vertex-count-to-gui' (#48) from issue/47-add-vertex-count-to-gui into dev
Reviewed-on: #48
2022-04-17 20:09:47 +02:00
c2ca2ff573 Rework the analysis cmd option to work with new statistics functions 2022-04-17 20:07:57 +02:00
8 changed files with 84 additions and 65 deletions

View File

@@ -5,6 +5,8 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
@@ -19,13 +21,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout Repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get -y install libgtk-3-dev gettext
sudo apt-get -y install libgtk-3-dev gettext cmake python3 libpython3-dev
echo "Installation successful"
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.

View File

@@ -1,3 +1,4 @@
cmake_minimum_required(VERSION 3.6...3.18)
project(gds-render LANGUAGES C)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
@@ -24,7 +25,7 @@ if(NOT WIN32)
set(BoldWhite "${Esc}[1;37m")
endif()
cmake_minimum_required(VERSION 2.8)
find_package(PkgConfig REQUIRED)
pkg_search_module(GLIB REQUIRED glib-2.0)
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
@@ -80,6 +81,7 @@ add_subdirectory(version)
set(FORT_ENABLE_TESTING OFF CACHE INTERNAL "")
add_subdirectory(3rdparty/libfort)
install(TARGETS fort EXCLUDE_FROM_ALL)
link_directories(${GLIB_LINK_DIRS} ${GTK3_LINK_DIRS} ${CAIRO_LINK_DIRS})
add_definitions(${GLIB2_CFLAGS_OTHER})

View File

@@ -61,18 +61,18 @@ struct analysis_format_cmdarg {
static const struct analysis_format_cmdarg analysis_format_lookup[] = {
{
.format = ANA_FORMAT_SIMPLE,
.argument = "simple",
},
{
.format = ANA_FORMAT_PRETTY,
.argument = "pretty",
},
{
.format = ANA_FORMAT_CELLS_ONLY,
.argument = "cellsonly"
}
{
.format = ANA_FORMAT_SIMPLE,
.argument = "simple",
},
{
.format = ANA_FORMAT_PRETTY,
.argument = "pretty",
},
{
.format = ANA_FORMAT_CELLS_ONLY,
.argument = "cellsonly"
}
};
static int string_array_count(char **string_array)
@@ -297,84 +297,92 @@ static int printf_indented(int level, const char *format, ...)
static void print_simple_stat(GList *lib_stat_list)
{
#if 0
int indentation_level = 0;
GList *lib_iter;
GList *cell_iter;
const struct gds_lib_statistics *lib_stats;
const struct gds_cell_statistics *cell_stats;
const struct gds_library *lib;
const struct gds_cell *cell;
const struct gds_lib_statistics *lib_stat;
const struct gds_cell_statistics *cell_stat;
for (lib_iter = lib_stat_list; lib_iter; lib_iter = g_list_next(lib_iter)) {
lib_stats = (const struct gds_lib_statistics *)lib_iter->data;
printf_indented(indentation_level, "Library %s\n", lib_stats->library->name);
lib = (const struct gds_library *)lib_iter->data;
lib_stat = &lib->stats;
printf_indented(indentation_level, "Library %s\n", lib->name);
indentation_level++;
for (cell_iter = lib_stats->cell_statistics; cell_iter; cell_iter = g_list_next(cell_iter)) {
cell_stats = (const struct gds_cell_statistics *)cell_iter->data;
printf_indented(indentation_level, "Cell %s\n", cell_stats->cell->name);
for (cell_iter = lib->cells; cell_iter; cell_iter = g_list_next(cell_iter)) {
cell = (const struct gds_cell *)cell_iter->data;
cell_stat = &cell->stats;
printf_indented(indentation_level, "Cell %s\n", cell->name);
indentation_level++;
printf_indented(indentation_level, "Reference count: %zu\n", cell_stats->reference_count);
printf_indented(indentation_level, "Graphics count: %zu\n", cell_stats->gfx_count);
printf_indented(indentation_level, "Vertex count: %zu\n", cell_stats->vertex_count);
printf_indented(indentation_level, "Reference count: %zu\n", cell_stat->reference_count);
printf_indented(indentation_level, "Graphics count: %zu\n", cell_stat->gfx_count);
printf_indented(indentation_level, "Total Graphics count: %zu\n", cell_stat->total_gfx_count);
printf_indented(indentation_level, "Vertex count: %zu\n", cell_stat->vertex_count);
printf_indented(indentation_level, "Total Vertex count: %zu\n", cell_stat->total_vertex_count);
printf_indented(indentation_level, "Unresolved children: %d\n",
cell_stats->cell->checks.unresolved_child_count);
cell->checks.unresolved_child_count);
printf_indented(indentation_level, "Reference loop: %s\n",
cell_stats->cell->checks.affected_by_reference_loop ? "yes" : "no");
cell->checks.affected_by_reference_loop ? "yes" : "no");
indentation_level--;
}
printf_indented(indentation_level, "Cell count: %zu\n", lib_stats->cell_count);
printf_indented(indentation_level, "Reference count: %zu\n", lib_stats->reference_count);
printf_indented(indentation_level, "Graphics count: %zu\n", lib_stats->gfx_count);
printf_indented(indentation_level, "Vertex count: %zu\n", lib_stats->vertex_count);
printf_indented(indentation_level, "Cell count: %zu\n", lib_stat->cell_count);
printf_indented(indentation_level, "Reference count: %zu\n", lib_stat->reference_count);
printf_indented(indentation_level, "Graphics count: %zu\n", lib_stat->gfx_count);
printf_indented(indentation_level, "Vertex count: %zu\n", lib_stat->vertex_count);
}
#endif
}
static void print_table_stat(GList *lib_stat_list)
static void table_stat_create_cell_row(struct gds_cell *cell, ft_table_t *tab)
{
#if 0
ft_table_t *table;
GList *lib_stat_iter;
GList *cell_stat_iter;
const struct gds_lib_statistics *lib_stats;
const struct gds_cell_statistics *cell_stats;
ft_printf_ln(tab, "%s|%s|%zu|%zu|%zu|%zu|%zu|%d|%s",
cell->parent_library->name,
cell->name,
cell->stats.gfx_count,
cell->stats.total_gfx_count,
cell->stats.vertex_count,
cell->stats.total_vertex_count,
cell->stats.reference_count,
cell->checks.unresolved_child_count,
cell->checks.affected_by_reference_loop ? "yes" : "no");
}
static void table_stat_table_for_lib(struct gds_library *lib, ft_table_t *tab)
{
ft_printf_ln(tab, "%s|%zu|%zu|-|%zu|-|%zu|-|-",
lib->name,
lib->stats.cell_count,
lib->stats.gfx_count,
lib->stats.vertex_count,
lib->stats.reference_count);
g_list_foreach(lib->cells, (GFunc)table_stat_create_cell_row, tab);
}
static void print_table_stat(GList *lib_list)
{
ft_table_t *table;
table = ft_create_table();
ft_set_cell_prop(table, 0, FT_ANY_COLUMN, FT_CPROP_ROW_TYPE, FT_ROW_HEADER);
ft_write_ln(table, "Library", "Cell", "GFX", "GFX+", "Vertices", "Vertices+", "Refs", "Unresolved Refs", "Loops");
ft_set_cell_prop(table, 0, FT_ANY_COLUMN, FT_CPROP_ROW_TYPE, FT_ROW_HEADER);
ft_write_ln(table, "Library", "Cell", "GFX", "Vertices", "Refs", "Unresolved Refs", "Loops");
for (lib_stat_iter = lib_stat_list; lib_stat_iter; lib_stat_iter = g_list_next(lib_stat_iter)) {
lib_stats = (const struct gds_lib_statistics *)lib_stat_iter->data;
ft_printf_ln(table, "%s|%zu|%zu|%zu|%zu|-|-", lib_stats->library->name, lib_stats->cell_count,
lib_stats->gfx_count, lib_stats->vertex_count, lib_stats->reference_count);
for (cell_stat_iter = lib_stats->cell_statistics; cell_stat_iter;
cell_stat_iter = g_list_next(cell_stat_iter)) {
cell_stats = (const struct gds_cell_statistics *)cell_stat_iter->data;
ft_printf_ln(table, "%s|%s|%zu|%zu|%zu|%d|%d", lib_stats->library->name, cell_stats->cell->name,
cell_stats->gfx_count, cell_stats->vertex_count, cell_stats->reference_count,
cell_stats->cell->checks.unresolved_child_count,
cell_stats->cell->checks.affected_by_reference_loop);
}
}
g_list_foreach(lib_list, (GFunc)table_stat_table_for_lib, table);
printf("%s\n", ft_to_string(table));
ft_destroy_table(table);
#endif
}
static void print_statistics(enum analysis_format format, GList *lib_stat_list)
static void print_statistics(enum analysis_format format, GList *lib_list)
{
switch (format) {
case ANA_FORMAT_PRETTY:
print_table_stat(lib_stat_list);
print_table_stat(lib_list);
break;
default:
print_simple_stat(lib_stat_list);
print_simple_stat(lib_list);
break;
}
}
@@ -448,6 +456,7 @@ int command_line_analyze_lib(const char *format, const char *gds_name)
goto return_clear_libs;
}
print_statistics(fmt, lib_list);
return_clear_libs:
clear_lib_list(&lib_list);

View File

@@ -284,8 +284,9 @@ static GList *append_library(GList *curr_list, const struct gds_library_parsing_
lib->stats.gfx_count = 0;
lib->stats.reference_count = 0;
lib->stats.vertex_count = 0;
} else
} else {
return NULL;
}
if (library_ptr)
*library_ptr = lib;
@@ -363,6 +364,7 @@ static GList *append_cell(GList *curr_list, struct gds_cell **cell_ptr)
cell->checks.affected_by_reference_loop = GDS_CELL_CHECK_NOT_RUN;
cell->stats.reference_count = 0;
cell->stats.total_vertex_count = 0;
cell->stats.total_gfx_count = 0;
cell->stats.gfx_count = 0;
cell->stats.vertex_count = 0;
} else

2
main.c
View File

@@ -201,7 +201,7 @@ static int start_gui(int argc, char **argv)
application_domain = g_string_new(NULL);
g_string_printf(application_domain, "de.shimatta.gds_render_%s", _app_git_commit);
gapp = gtk_application_new(application_domain->str, G_APPLICATION_FLAGS_NONE);
gapp = gtk_application_new(application_domain->str, G_APPLICATION_DEFAULT_FLAGS);
g_string_free(application_domain, TRUE);
g_application_register(G_APPLICATION(gapp), NULL, NULL);

View File

@@ -1,5 +1,5 @@
project(pluginexample)
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 2.8...3.18)
find_package(PkgConfig REQUIRED)
pkg_search_module(PYTHON REQUIRED python3)

View File

@@ -22,7 +22,7 @@ if(NOT WIN32)
set(BoldWhite "${Esc}[1;37m")
endif()
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 2.8...3.18)
find_package(PkgConfig REQUIRED)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/catch-framework")