From abfe9442999714cc7f9ddba7f0d69217f4316321 Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Wed, 11 May 2022 19:48:56 -0400 Subject: [PATCH] Split gal cmake target to a subdirectory --- common/CMakeLists.txt | 70 ++------------------------------------- common/gal/CMakeLists.txt | 60 +++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 68 deletions(-) create mode 100644 common/gal/CMakeLists.txt diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 2af69a3a24..62bf4507af 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -19,72 +19,14 @@ include_directories( ${INC_AFTER} ) -set( GAL_SRCS - # Common part - callback_gal.cpp - draw_panel_gal.cpp - gl_context_mgr.cpp - newstroke_font.cpp - painter.cpp - gal/color4d.cpp - gal/cursors.cpp - gal/dpi_scaling.cpp - gal/gal_display_options.cpp - gal/graphics_abstraction_layer.cpp - gal/hidpi_gl_canvas.cpp - - view/view_controls.cpp - view/view_overlay.cpp - view/wx_view_controls.cpp - view/zoom_controller.cpp - - # OpenGL GAL - gal/opengl/opengl_gal.cpp - gal/opengl/gl_resources.cpp - gal/opengl/gl_builtin_shaders.cpp - gal/opengl/shader.cpp - gal/opengl/vertex_item.cpp - gal/opengl/vertex_container.cpp - gal/opengl/cached_container.cpp - gal/opengl/cached_container_gpu.cpp - gal/opengl/cached_container_ram.cpp - gal/opengl/noncached_container.cpp - gal/opengl/vertex_manager.cpp - gal/opengl/gpu_manager.cpp - gal/opengl/antialiasing.cpp - gal/opengl/opengl_compositor.cpp - gal/opengl/utils.cpp - - # Cairo GAL - gal/cairo/cairo_gal.cpp - gal/cairo/cairo_compositor.cpp - gal/cairo/cairo_print.cpp - ) - -add_library( gal STATIC ${GAL_SRCS} ) - -target_link_libraries( gal - common # This is needed until the circular dependency is removed - kimath - nlohmann_json - ${GLEW_LIBRARIES} - ${CAIRO_LIBRARIES} - ${PIXMAN_LIBRARIES} - ${OPENGL_LIBRARIES} - ${GDI_PLUS_LIBRARIES} - # outline font support - ${FREETYPE_LIBRARIES} - ${HarfBuzz_LIBRARIES} - ${Fontconfig_LIBRARIES} -) - +# Get the GAL Target +add_subdirectory( gal ) # Only for win32 cross compilation using MXE if( WIN32 AND MSYS ) add_definitions( -DGLEW_STATIC ) endif() - # A shared library subsetted from common which restricts what can go into # a single_top link image. By not linking to common, we control what does # statically go into single_top link images. My current thinking is that only @@ -658,14 +600,6 @@ make_lexer( stroke_params_keywords.cpp STROKEPARAMS_T ) -# works on msys2: -make_lexer( - gal - stroke_params.keywords - stroke_params_lexer.h - stroke_params_keywords.cpp - STROKEPARAMS_T - ) # auto-generate netlist_lexer.h and netlist_keywords.cpp make_lexer( diff --git a/common/gal/CMakeLists.txt b/common/gal/CMakeLists.txt new file mode 100644 index 0000000000..c5a66333bb --- /dev/null +++ b/common/gal/CMakeLists.txt @@ -0,0 +1,60 @@ + +set( GAL_SRCS + # Common part + ../callback_gal.cpp + ../draw_panel_gal.cpp + ../gl_context_mgr.cpp + ../newstroke_font.cpp + ../painter.cpp + color4d.cpp + cursors.cpp + dpi_scaling.cpp + gal_display_options.cpp + graphics_abstraction_layer.cpp + hidpi_gl_canvas.cpp + + ../view/view_controls.cpp + ../view/view_overlay.cpp + ../view/wx_view_controls.cpp + ../view/zoom_controller.cpp + + # OpenGL GAL + opengl/opengl_gal.cpp + opengl/gl_resources.cpp + opengl/gl_builtin_shaders.cpp + opengl/shader.cpp + opengl/vertex_item.cpp + opengl/vertex_container.cpp + opengl/cached_container.cpp + opengl/cached_container_gpu.cpp + opengl/cached_container_ram.cpp + opengl/noncached_container.cpp + opengl/vertex_manager.cpp + opengl/gpu_manager.cpp + opengl/antialiasing.cpp + opengl/opengl_compositor.cpp + opengl/utils.cpp + + # Cairo GAL + cairo/cairo_gal.cpp + cairo/cairo_compositor.cpp + cairo/cairo_print.cpp + ) + +add_library( gal STATIC ${GAL_SRCS} ) + +target_link_libraries( gal + common # This is needed until the circular dependency is removed + kimath + nlohmann_json + ${GLEW_LIBRARIES} + ${CAIRO_LIBRARIES} + ${PIXMAN_LIBRARIES} + ${OPENGL_LIBRARIES} + ${GDI_PLUS_LIBRARIES} + # outline font support + ${FREETYPE_LIBRARIES} + ${HarfBuzz_LIBRARIES} + ${Fontconfig_LIBRARIES} +) +