diff options
-rw-r--r-- | bindings/cpp/include/meson.build | 12 | ||||
-rw-r--r-- | bindings/cpp/meson.build | 7 | ||||
-rw-r--r-- | include/meson.build | 12 | ||||
-rw-r--r-- | meson.build | 40 |
4 files changed, 37 insertions, 34 deletions
diff --git a/bindings/cpp/include/meson.build b/bindings/cpp/include/meson.build new file mode 100644 index 0000000..8d5c563 --- /dev/null +++ b/bindings/cpp/include/meson.build @@ -0,0 +1,12 @@ +cpp_headers = [ + 'pugl/pugl.hpp', + + 'pugl/cairo.hpp', + 'pugl/gl.hpp', + 'pugl/stub.hpp', + 'pugl/vulkan.hpp', +] + +cpp_header_files = files(cpp_headers) + +install_headers(cpp_headers, subdir: 'puglpp' + version_suffix / 'pugl') diff --git a/bindings/cpp/meson.build b/bindings/cpp/meson.build new file mode 100644 index 0000000..7f47f43 --- /dev/null +++ b/bindings/cpp/meson.build @@ -0,0 +1,7 @@ +subdir('include') + +pkg.generate(name: 'Pugl++', + filebase: 'puglpp-@0@'.format(major_version), + subdirs: ['puglpp-@0@'.format(major_version)], + version: meson.project_version(), + description: 'Pugl GUI library C++ bindings') diff --git a/include/meson.build b/include/meson.build new file mode 100644 index 0000000..2e1f7d8 --- /dev/null +++ b/include/meson.build @@ -0,0 +1,12 @@ +c_headers = [ + 'pugl/pugl.h', + + 'pugl/cairo.h', + 'pugl/gl.h', + 'pugl/stub.h', + 'pugl/vulkan.h', +] + +c_header_files = files(c_headers) + +install_headers(c_headers, subdir: versioned_name / 'pugl') diff --git a/meson.build b/meson.build index e83e9e4..ae4c03c 100644 --- a/meson.build +++ b/meson.build @@ -95,32 +95,6 @@ endif add_project_arguments(['-DPUGL_DISABLE_DEPRECATED'], language: ['c', 'cpp', 'objc']) -c_headers = [ - 'include/pugl/pugl.h', - - 'include/pugl/cairo.h', - 'include/pugl/gl.h', - 'include/pugl/stub.h', - 'include/pugl/vulkan.h', -] - -c_header_files = files(c_headers) - -cpp_headers = [ - 'bindings/cpp/include/pugl/pugl.hpp', - - 'bindings/cpp/include/pugl/cairo.hpp', - 'bindings/cpp/include/pugl/gl.hpp', - 'bindings/cpp/include/pugl/stub.hpp', - 'bindings/cpp/include/pugl/vulkan.hpp', -] - -cpp_header_files = files(cpp_headers) - -core_sources = [ - 'src/implementation.c' -] - # System libraries m_dep = cc.find_library('m', required: false) dl_dep = cc.find_library('dl', required: false) @@ -215,6 +189,7 @@ endif core_deps += [m_dep] core_name = 'pugl_@0@@1@'.format(platform, version_suffix) +# Determine library type and set up defines for building them library_args = ['-DPUGL_INTERNAL'] if get_option('default_library') == 'both' if host_machine.system() == 'windows' @@ -229,6 +204,7 @@ else add_project_arguments(['-DPUGL_STATIC'], language: ['c', 'cpp', 'objc']) endif +# Build core library libpugl = build_target( core_name, files('src/implementation.c') + platform_sources, @@ -242,6 +218,7 @@ libpugl = build_target( pugl_dep = declare_dependency(link_with: libpugl, dependencies: core_deps) +# Build pkg-config file pkg.generate(libpugl, name: 'Pugl', filebase: versioned_name, @@ -363,14 +340,9 @@ if vulkan_dep.found() description: 'Pugl GUI library with Vulkan backend') endif -install_headers(c_headers, subdir: versioned_name / 'pugl') -install_headers(cpp_headers, subdir: 'puglpp' + version_suffix / 'pugl') - -pkg.generate(name: 'Pugl++', - filebase: 'puglpp-@0@'.format(major_version), - subdirs: ['puglpp-@0@'.format(major_version)], - version: meson.project_version(), - description: 'Pugl GUI library C++ bindings') +# Process all headers first so they are available for building documentation +subdir('include') +subdir('bindings/cpp') if not get_option('docs').disabled() subdir('doc') |