aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--CMakeLists.txt2
m---------lib/cairo0
-rw-r--r--lib/meson-projects/meson.build7
-rw-r--r--lib/meson-projects/meson_options.txt11
-rw-r--r--lib/meson-projects/subprojects/.gitignore5
-rw-r--r--lib/meson-projects/subprojects/cairo.wrap7
-rw-r--r--lib/meson-projects/subprojects/pango.wrap7
-rw-r--r--scripts/cmake/cairo.cmake25
-rw-r--r--scripts/cmake/meson-projects.cmake25
-rw-r--r--src/platform/graphics/cairo/CMakeLists.txt6
11 files changed, 66 insertions, 32 deletions
diff --git a/.gitmodules b/.gitmodules
index f382b935..056b9ef1 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -7,6 +7,3 @@
[submodule "lib/Catch2"]
path = lib/Catch2
url = https://github.com/catchorg/Catch2.git
-[submodule "lib/cairo"]
- path = lib/cairo
- url = https://gitlab.freedesktop.org/cairo/cairo.git
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ca73ada3..52cc7a5f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -47,7 +47,7 @@ function(target_add_resources target res_dir)
endforeach(RES_FILE)
endfunction()
-include(scripts/cmake/cairo.cmake)
+include(scripts/cmake/meson-projects.cmake)
add_subdirectory(src)
add_subdirectory(test)
diff --git a/lib/cairo b/lib/cairo
deleted file mode 160000
-Subproject f9de19ad745e587743914a37b1ee3ff804723a0
diff --git a/lib/meson-projects/meson.build b/lib/meson-projects/meson.build
new file mode 100644
index 00000000..5b2b6a4d
--- /dev/null
+++ b/lib/meson-projects/meson.build
@@ -0,0 +1,7 @@
+project('cru-deps', 'c', 'cpp')
+
+alias_target('all',
+ dependency('cairo', fallback: ['cairo', 'cairo_dep'], required: get_option('cairo')),
+ dependency('pango', fallback: ['pango', 'pango_deps'], required: get_option('pango'))
+)
+
diff --git a/lib/meson-projects/meson_options.txt b/lib/meson-projects/meson_options.txt
new file mode 100644
index 00000000..b905968d
--- /dev/null
+++ b/lib/meson-projects/meson_options.txt
@@ -0,0 +1,11 @@
+option(
+ 'cairo',
+ type: 'feature',
+ value: 'auto',
+)
+
+option(
+ 'pango',
+ type: 'feature',
+ value: 'auto'
+)
diff --git a/lib/meson-projects/subprojects/.gitignore b/lib/meson-projects/subprojects/.gitignore
new file mode 100644
index 00000000..a268818f
--- /dev/null
+++ b/lib/meson-projects/subprojects/.gitignore
@@ -0,0 +1,5 @@
+*
+!.gitignore
+!cairo.wrap
+!pango.wrap
+
diff --git a/lib/meson-projects/subprojects/cairo.wrap b/lib/meson-projects/subprojects/cairo.wrap
new file mode 100644
index 00000000..8f12b5cc
--- /dev/null
+++ b/lib/meson-projects/subprojects/cairo.wrap
@@ -0,0 +1,7 @@
+[wrap-git]
+directory = cairo
+url = https://gitlab.freedesktop.org/cairo/cairo.git
+push-url = ssh://git@gitlab.freedesktop.org:cairo/cairo.git
+revision = master
+depth = 1
+
diff --git a/lib/meson-projects/subprojects/pango.wrap b/lib/meson-projects/subprojects/pango.wrap
new file mode 100644
index 00000000..b29457c2
--- /dev/null
+++ b/lib/meson-projects/subprojects/pango.wrap
@@ -0,0 +1,7 @@
+[wrap-git]
+directory = pango
+url = https://gitlab.freedesktop.org/GNOME/pango.git
+push-url = ssh://git@gitlab.freedesktop.org:GNOME/pango.git
+revision = master
+depth = 1
+
diff --git a/scripts/cmake/cairo.cmake b/scripts/cmake/cairo.cmake
deleted file mode 100644
index 88836222..00000000
--- a/scripts/cmake/cairo.cmake
+++ /dev/null
@@ -1,25 +0,0 @@
-find_program(MESON meson REQUIRED)
-find_program(NINJA ninja REQUIRED)
-
-set(CAIRO_BUILD_DIR ${CMAKE_BINARY_DIR}/cairo/build)
-set(CAIRO_INSTALL_DIR ${CMAKE_BINARY_DIR}/cairo/install)
-
-set(CAIRO_MESON_SETUP meson setup ${CAIRO_BUILD_DIR} --prefix=${CAIRO_INSTALL_DIR})
-
-if(EMSCRIPTEN)
- cmake_path(GET CMAKE_C_COMPILER PARENT_PATH EMSCRIPTEN_TOOLCHAIN)
- set(EMSCRIPTEN_CROSS_FILE_TEMPLATE ${PROJECT_SOURCE_DIR}/scripts/meson-emscripten.ini.in)
- set(EMSCRIPTEN_CROSS_FILE ${CAIRO_BUILD_DIR}/emscripten.ini)
- configure_file(${EMSCRIPTEN_CROSS_FILE_TEMPLATE} ${EMSCRIPTEN_CROSS_FILE})
- set(CAIRO_MESON_SETUP ${CAIRO_MESON_SETUP} --cross-file ${EMSCRIPTEN_CROSS_FILE})
-endif()
-
-add_custom_target(
- cairo-build
- COMMAND mkdir -p ${CAIRO_BUILD_DIR} ${CAIRO_INSTALL_DIR}
- COMMAND ${CAIRO_MESON_SETUP}
- COMMAND ninja -C ${CAIRO_BUILD_DIR}
- COMMAND ninja -C ${CAIRO_BUILD_DIR} install
- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/lib/cairo
-)
-
diff --git a/scripts/cmake/meson-projects.cmake b/scripts/cmake/meson-projects.cmake
new file mode 100644
index 00000000..94b3729d
--- /dev/null
+++ b/scripts/cmake/meson-projects.cmake
@@ -0,0 +1,25 @@
+find_program(MESON meson REQUIRED)
+find_program(NINJA ninja REQUIRED)
+
+set(MESON_PROJECTS_BUILD_DIR ${CMAKE_BINARY_DIR}/meson-projects/build)
+set(MESON_PROJECTS_INSTALL_DIR ${CMAKE_BINARY_DIR}/meson-projects/install)
+
+set(MESON_PROJECTS_MESON_SETUP meson setup ${MESON_PROJECTS_BUILD_DIR} --prefix=${MESON_PROJECTS_INSTALL_DIR})
+
+if(EMSCRIPTEN)
+ cmake_path(GET CMAKE_C_COMPILER PARENT_PATH EMSCRIPTEN_TOOLCHAIN)
+ set(EMSCRIPTEN_CROSS_FILE_TEMPLATE ${PROJECT_SOURCE_DIR}/scripts/meson-emscripten.ini.in)
+ set(EMSCRIPTEN_CROSS_FILE ${MESON_PROJECTS_BUILD_DIR}/emscripten.ini)
+ configure_file(${EMSCRIPTEN_CROSS_FILE_TEMPLATE} ${EMSCRIPTEN_CROSS_FILE})
+ set(MESON_PROJECTS_MESON_SETUP ${MESON_PROJECTS_MESON_SETUP} --cross-file ${EMSCRIPTEN_CROSS_FILE})
+endif()
+
+add_custom_target(
+ build-meson-projects
+ COMMAND mkdir -p ${MESON_PROJECTS_BUILD_DIR} ${MESON_PROJECTS_INSTALL_DIR}
+ COMMAND ${MESON_PROJECTS_MESON_SETUP}
+ COMMAND ninja -C ${MESON_PROJECTS_BUILD_DIR}
+ COMMAND ninja -C ${MESON_PROJECTS_BUILD_DIR} install
+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/lib/meson-projects
+)
+
diff --git a/src/platform/graphics/cairo/CMakeLists.txt b/src/platform/graphics/cairo/CMakeLists.txt
index 73b18499..48339f7c 100644
--- a/src/platform/graphics/cairo/CMakeLists.txt
+++ b/src/platform/graphics/cairo/CMakeLists.txt
@@ -35,7 +35,7 @@ if (UNIX AND NOT EMSCRIPTEN) # It's so great to see emscripten is somewhat UNIX!
endif()
if (EMSCRIPTEN)
- add_dependencies(CruPlatformGraphicsCairo cairo-build)
- target_link_libraries(CruPlatformGraphicsCairo PUBLIC CruPlatformGraphics PUBLIC ${CAIRO_INSTALL_DIR}/lib/libcairo.a)
- target_include_directories(CruPlatformGraphicsCairo PUBLIC ${CAIRO_INSTALL_DIR}/include)
+ add_dependencies(CruPlatformGraphicsCairo build-meson-projects)
+ target_link_libraries(CruPlatformGraphicsCairo PUBLIC CruPlatformGraphics PUBLIC ${MESON_PROJECTS_INSTALL_DIR}/lib/libcairo.a)
+ target_include_directories(CruPlatformGraphicsCairo PUBLIC ${MESON_PROJECTS_INSTALL_DIR}/include)
endif()