aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-10-29 13:35:22 +0100
committerDavid Robillard <d@drobilla.net>2020-10-30 10:58:26 +0100
commit21d1e350a3b22ba690553f8371714fd9e896c7c8 (patch)
tree74db24524d3dca6214dc9d910881ac7dbb38a7d5
parent4ae4dd5b09c04246cd5cfc26572d3840e993b95a (diff)
downloadpugl-21d1e350a3b22ba690553f8371714fd9e896c7c8.tar.gz
pugl-21d1e350a3b22ba690553f8371714fd9e896c7c8.tar.bz2
pugl-21d1e350a3b22ba690553f8371714fd9e896c7c8.zip
Move implementation source files to a conventional src directory
I think this attempt to be optionally header-only was misguided, particularly installing source code to the system include path. Typically anyone vendoring code just includes the repository and builds from there anyway. This commit moves all the implementation code to a typical src directory (Don't Be Weird). I still think there is some value in simple "inline" deployment, but that would be better achieved another way, like producing a single-file amalgamation that builds anywhere, ala sqlite.
-rw-r--r--src/.clang-tidy (renamed from include/pugl/detail/.clang-tidy)0
-rw-r--r--src/implementation.c (renamed from include/pugl/detail/implementation.c)3
-rw-r--r--src/implementation.h (renamed from include/pugl/detail/implementation.h)3
-rw-r--r--src/mac.h (renamed from include/pugl/detail/mac.h)0
-rw-r--r--src/mac.m (renamed from include/pugl/detail/mac.m)5
-rw-r--r--src/mac_cairo.m (renamed from include/pugl/detail/mac_cairo.m)7
-rw-r--r--src/mac_gl.m (renamed from include/pugl/detail/mac_gl.m)7
-rw-r--r--src/mac_stub.m (renamed from include/pugl/detail/mac_stub.m)7
-rw-r--r--src/mac_vulkan.m (renamed from include/pugl/detail/mac_vulkan.m)9
-rw-r--r--src/stub.h (renamed from include/pugl/detail/stub.h)0
-rw-r--r--src/types.h (renamed from include/pugl/detail/types.h)0
-rw-r--r--src/win.c (renamed from include/pugl/detail/win.c)7
-rw-r--r--src/win.h (renamed from include/pugl/detail/win.h)2
-rw-r--r--src/win_cairo.c (renamed from include/pugl/detail/win_cairo.c)7
-rw-r--r--src/win_gl.c (renamed from include/pugl/detail/win_gl.c)7
-rw-r--r--src/win_stub.c (renamed from include/pugl/detail/win_stub.c)8
-rw-r--r--src/win_vulkan.c (renamed from include/pugl/detail/win_vulkan.c)7
-rw-r--r--src/x11.c (renamed from include/pugl/detail/x11.c)7
-rw-r--r--src/x11.h (renamed from include/pugl/detail/x11.h)3
-rw-r--r--src/x11_cairo.c (renamed from include/pugl/detail/x11_cairo.c)5
-rw-r--r--src/x11_gl.c (renamed from include/pugl/detail/x11_gl.c)7
-rw-r--r--src/x11_stub.c (renamed from include/pugl/detail/x11_stub.c)7
-rw-r--r--src/x11_vulkan.c (renamed from include/pugl/detail/x11_vulkan.c)7
-rw-r--r--wscript49
24 files changed, 85 insertions, 79 deletions
diff --git a/include/pugl/detail/.clang-tidy b/src/.clang-tidy
index 7bc36f7..7bc36f7 100644
--- a/include/pugl/detail/.clang-tidy
+++ b/src/.clang-tidy
diff --git a/include/pugl/detail/implementation.c b/src/implementation.c
index 4f0776a..74c6aea 100644
--- a/include/pugl/detail/implementation.c
+++ b/src/implementation.c
@@ -19,7 +19,8 @@
@brief Platform-independent implementation.
*/
-#include "pugl/detail/implementation.h"
+#include "implementation.h"
+
#include "pugl/pugl.h"
#include <assert.h>
diff --git a/include/pugl/detail/implementation.h b/src/implementation.h
index c40a2bb..3a8b6ca 100644
--- a/include/pugl/detail/implementation.h
+++ b/src/implementation.h
@@ -22,7 +22,8 @@
#ifndef PUGL_DETAIL_IMPLEMENTATION_H
#define PUGL_DETAIL_IMPLEMENTATION_H
-#include "pugl/detail/types.h"
+#include "types.h"
+
#include "pugl/pugl.h"
#include <stddef.h>
diff --git a/include/pugl/detail/mac.h b/src/mac.h
index d31eb91..d31eb91 100644
--- a/include/pugl/detail/mac.h
+++ b/src/mac.h
diff --git a/include/pugl/detail/mac.m b/src/mac.m
index a807761..3d1fba2 100644
--- a/include/pugl/detail/mac.m
+++ b/src/mac.m
@@ -22,9 +22,10 @@
#define GL_SILENCE_DEPRECATION 1
-#include "pugl/detail/mac.h"
+#include "mac.h"
+
+#include "implementation.h"
-#include "pugl/detail/implementation.h"
#include "pugl/pugl.h"
#import <Cocoa/Cocoa.h>
diff --git a/include/pugl/detail/mac_cairo.m b/src/mac_cairo.m
index a8c05ec..dd8fd36 100644
--- a/include/pugl/detail/mac_cairo.m
+++ b/src/mac_cairo.m
@@ -19,9 +19,10 @@
@brief Cairo graphics backend for MacOS.
*/
-#include "pugl/detail/implementation.h"
-#include "pugl/detail/mac.h"
-#include "pugl/detail/stub.h"
+#include "implementation.h"
+#include "mac.h"
+#include "stub.h"
+
#include "pugl/pugl_cairo.h"
#include <cairo-quartz.h>
diff --git a/include/pugl/detail/mac_gl.m b/src/mac_gl.m
index bca790d..038b942 100644
--- a/include/pugl/detail/mac_gl.m
+++ b/src/mac_gl.m
@@ -19,9 +19,10 @@
@brief OpenGL graphics backend for MacOS.
*/
-#include "pugl/detail/implementation.h"
-#include "pugl/detail/mac.h"
-#include "pugl/detail/stub.h"
+#include "implementation.h"
+#include "mac.h"
+#include "stub.h"
+
#include "pugl/pugl_gl.h"
#ifndef __MAC_10_10
diff --git a/include/pugl/detail/mac_stub.m b/src/mac_stub.m
index e6aa895..b4d9058 100644
--- a/include/pugl/detail/mac_stub.m
+++ b/src/mac_stub.m
@@ -19,9 +19,10 @@
@brief Stub graphics backend for MacOS.
*/
-#include "pugl/detail/implementation.h"
-#include "pugl/detail/mac.h"
-#include "pugl/detail/stub.h"
+#include "implementation.h"
+#include "mac.h"
+#include "stub.h"
+
#include "pugl/pugl_stub.h"
#import <Cocoa/Cocoa.h>
diff --git a/include/pugl/detail/mac_vulkan.m b/src/mac_vulkan.m
index 813e0ae..90d349b 100644
--- a/include/pugl/detail/mac_vulkan.m
+++ b/src/mac_vulkan.m
@@ -20,10 +20,11 @@
#define VK_NO_PROTOTYPES 1
-#include "pugl/detail/implementation.h"
-#include "pugl/detail/mac.h"
-#include "pugl/detail/stub.h"
-#include "pugl/detail/types.h"
+#include "implementation.h"
+#include "mac.h"
+#include "stub.h"
+#include "types.h"
+
#include "pugl/pugl.h"
#include "pugl/pugl_stub.h"
#include "pugl/pugl_vulkan.h"
diff --git a/include/pugl/detail/stub.h b/src/stub.h
index acd3181..acd3181 100644
--- a/include/pugl/detail/stub.h
+++ b/src/stub.h
diff --git a/include/pugl/detail/types.h b/src/types.h
index e18eb87..e18eb87 100644
--- a/include/pugl/detail/types.h
+++ b/src/types.h
diff --git a/include/pugl/detail/win.c b/src/win.c
index 237ebde..0578749 100644
--- a/include/pugl/detail/win.c
+++ b/src/win.c
@@ -19,10 +19,11 @@
@brief Windows implementation.
*/
-#include "pugl/detail/win.h"
+#include "win.h"
+
+#include "implementation.h"
+#include "stub.h"
-#include "pugl/detail/implementation.h"
-#include "pugl/detail/stub.h"
#include "pugl/pugl.h"
#include "pugl/pugl_stub.h"
diff --git a/include/pugl/detail/win.h b/src/win.h
index 4c0a3c0..bd85cb1 100644
--- a/include/pugl/detail/win.h
+++ b/src/win.h
@@ -22,7 +22,7 @@
#ifndef PUGL_DETAIL_WIN_H
#define PUGL_DETAIL_WIN_H
-#include "pugl/detail/implementation.h"
+#include "implementation.h"
#include <windows.h>
diff --git a/include/pugl/detail/win_cairo.c b/src/win_cairo.c
index 866569c..18c4a95 100644
--- a/include/pugl/detail/win_cairo.c
+++ b/src/win_cairo.c
@@ -19,9 +19,10 @@
@brief Cairo graphics backend for Windows.
*/
-#include "pugl/detail/stub.h"
-#include "pugl/detail/types.h"
-#include "pugl/detail/win.h"
+#include "stub.h"
+#include "types.h"
+#include "win.h"
+
#include "pugl/pugl_cairo.h"
#include <cairo-win32.h>
diff --git a/include/pugl/detail/win_gl.c b/src/win_gl.c
index 4f71d76..f011f5b 100644
--- a/include/pugl/detail/win_gl.c
+++ b/src/win_gl.c
@@ -19,9 +19,10 @@
@brief OpenGL graphics backend for Windows.
*/
-#include "pugl/detail/stub.h"
-#include "pugl/detail/types.h"
-#include "pugl/detail/win.h"
+#include "stub.h"
+#include "types.h"
+#include "win.h"
+
#include "pugl/pugl_gl.h"
#include <windows.h>
diff --git a/include/pugl/detail/win_stub.c b/src/win_stub.c
index ab9e6aa..e066e4d 100644
--- a/include/pugl/detail/win_stub.c
+++ b/src/win_stub.c
@@ -14,11 +14,11 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include "pugl/pugl_stub.h"
+#include "stub.h"
+#include "types.h"
+#include "win.h"
-#include "pugl/detail/stub.h"
-#include "pugl/detail/types.h"
-#include "pugl/detail/win.h"
+#include "pugl/pugl_stub.h"
PuglStatus
puglWinStubConfigure(PuglView* view)
diff --git a/include/pugl/detail/win_vulkan.c b/src/win_vulkan.c
index cfe3613..5e3622e 100644
--- a/include/pugl/detail/win_vulkan.c
+++ b/src/win_vulkan.c
@@ -20,9 +20,10 @@
#define VK_NO_PROTOTYPES 1
-#include "pugl/detail/stub.h"
-#include "pugl/detail/types.h"
-#include "pugl/detail/win.h"
+#include "stub.h"
+#include "types.h"
+#include "win.h"
+
#include "pugl/pugl_stub.h"
#include "pugl/pugl_vulkan.h"
diff --git a/include/pugl/detail/x11.c b/src/x11.c
index fd76606..18f8521 100644
--- a/include/pugl/detail/x11.c
+++ b/src/x11.c
@@ -23,10 +23,11 @@
#define _POSIX_C_SOURCE 199309L
-#include "pugl/detail/x11.h"
+#include "x11.h"
+
+#include "implementation.h"
+#include "types.h"
-#include "pugl/detail/implementation.h"
-#include "pugl/detail/types.h"
#include "pugl/pugl.h"
#include <X11/X.h>
diff --git a/include/pugl/detail/x11.h b/src/x11.h
index 9788191..3705cd9 100644
--- a/include/pugl/detail/x11.h
+++ b/src/x11.h
@@ -22,7 +22,8 @@
#ifndef PUGL_DETAIL_X11_H
#define PUGL_DETAIL_X11_H
-#include "pugl/detail/types.h"
+#include "types.h"
+
#include "pugl/pugl.h"
#include <X11/X.h>
diff --git a/include/pugl/detail/x11_cairo.c b/src/x11_cairo.c
index 0112c4e..f0b38a9 100644
--- a/include/pugl/detail/x11_cairo.c
+++ b/src/x11_cairo.c
@@ -19,8 +19,9 @@
@brief Cairo graphics backend for X11.
*/
-#include "pugl/detail/types.h"
-#include "pugl/detail/x11.h"
+#include "types.h"
+#include "x11.h"
+
#include "pugl/pugl.h"
#include "pugl/pugl_cairo.h"
diff --git a/include/pugl/detail/x11_gl.c b/src/x11_gl.c
index d89a350..72c2421 100644
--- a/include/pugl/detail/x11_gl.c
+++ b/src/x11_gl.c
@@ -19,9 +19,10 @@
@brief OpenGL graphics backend for X11.
*/
-#include "pugl/detail/stub.h"
-#include "pugl/detail/types.h"
-#include "pugl/detail/x11.h"
+#include "stub.h"
+#include "types.h"
+#include "x11.h"
+
#include "pugl/pugl.h"
#include "pugl/pugl_gl.h"
diff --git a/include/pugl/detail/x11_stub.c b/src/x11_stub.c
index 093066b..0f2e6d2 100644
--- a/include/pugl/detail/x11_stub.c
+++ b/src/x11_stub.c
@@ -16,9 +16,10 @@
#include "pugl/pugl_stub.h"
-#include "pugl/detail/stub.h"
-#include "pugl/detail/types.h"
-#include "pugl/detail/x11.h"
+#include "stub.h"
+#include "types.h"
+#include "x11.h"
+
#include "pugl/pugl.h"
#include <X11/Xutil.h>
diff --git a/include/pugl/detail/x11_vulkan.c b/src/x11_vulkan.c
index 0bd1532..1ca2ace 100644
--- a/include/pugl/detail/x11_vulkan.c
+++ b/src/x11_vulkan.c
@@ -20,9 +20,10 @@
#define VK_NO_PROTOTYPES 1
-#include "pugl/detail/stub.h"
-#include "pugl/detail/types.h"
-#include "pugl/detail/x11.h"
+#include "stub.h"
+#include "types.h"
+#include "x11.h"
+
#include "pugl/pugl.h"
#include "pugl/pugl_vulkan.h"
diff --git a/wscript b/wscript
index 205072b..93ba6ba 100644
--- a/wscript
+++ b/wscript
@@ -55,7 +55,6 @@ def configure(conf):
if 'COMPILER_CXX' in conf.env:
autowaf.set_cxx_lang(conf, 'c++11')
- conf.env.ALL_HEADERS = Options.options.all_headers
conf.env.TARGET_PLATFORM = Options.options.target or sys.platform
platform = conf.env.TARGET_PLATFORM
@@ -357,12 +356,6 @@ def build(bld):
bld.install_files(includedir, bld.path.ant_glob('include/pugl/*.h'))
bld.install_files(includedir, bld.path.ant_glob('include/pugl/*.hpp'))
bld.install_files(includedir, bld.path.ant_glob('include/pugl/*.ipp'))
- if bld.env.ALL_HEADERS:
- detaildir = os.path.join(includedir, 'detail')
- bld.install_files(detaildir,
- bld.path.ant_glob('include/pugl/detail/*.h'))
- bld.install_files(detaildir,
- bld.path.ant_glob('include/pugl/detail/*.c'))
# Library dependencies of pugl libraries (for building examples)
deps = {}
@@ -418,86 +411,82 @@ def build(bld):
deps=kwargs,
requires=['pugl-%s' % PUGL_MAJOR_VERSION])
- lib_source = ['include/pugl/detail/implementation.c']
+ lib_source = ['src/implementation.c']
if bld.env.TARGET_PLATFORM == 'win32':
platform = 'win'
build_platform('win',
uselib=['GDI32', 'USER32'],
- source=lib_source + ['include/pugl/detail/win.c'])
+ source=lib_source + ['src/win.c'])
build_backend('win', 'stub',
uselib=['GDI32', 'USER32'],
- source=['include/pugl/detail/win_stub.c'])
+ source=['src/win_stub.c'])
if bld.env.HAVE_GL:
build_backend('win', 'gl',
uselib=['GDI32', 'USER32', 'GL'],
- source=['include/pugl/detail/win_gl.c'])
+ source=['src/win_gl.c'])
if bld.env.HAVE_VULKAN:
build_backend('win', 'vulkan',
uselib=['GDI32', 'USER32', 'VULKAN'],
- source=['include/pugl/detail/win_vulkan.c',
- 'include/pugl/detail/win_stub.c'])
+ source=['src/win_vulkan.c', 'src/win_stub.c'])
if bld.env.HAVE_CAIRO:
build_backend('win', 'cairo',
uselib=['CAIRO', 'GDI32', 'USER32'],
- source=['include/pugl/detail/win_cairo.c',
- 'include/pugl/detail/win_stub.c'])
+ source=['src/win_cairo.c', 'src/win_stub.c'])
elif bld.env.TARGET_PLATFORM == 'darwin':
platform = 'mac'
build_platform('mac',
framework=['Cocoa', 'Corevideo'],
- source=lib_source + ['include/pugl/detail/mac.m'])
+ source=lib_source + ['src/mac.m'])
build_backend('mac', 'stub',
framework=['Cocoa', 'Corevideo'],
- source=['include/pugl/detail/mac_stub.m'])
+ source=['src/mac_stub.m'])
if bld.env.HAVE_GL:
build_backend('mac', 'gl',
framework=['Cocoa', 'Corevideo', 'OpenGL'],
- source=['include/pugl/detail/mac_gl.m'])
+ source=['src/mac_gl.m'])
if bld.env.HAVE_VULKAN:
build_backend('mac', 'vulkan',
framework=['Cocoa', 'QuartzCore'],
- source=['include/pugl/detail/mac_vulkan.m'])
+ source=['src/mac_vulkan.m'])
if bld.env.HAVE_CAIRO:
build_backend('mac', 'cairo',
framework=['Cocoa', 'Corevideo'],
uselib=['CAIRO'],
- source=['include/pugl/detail/mac_cairo.m'])
+ source=['src/mac_cairo.m'])
else:
platform = 'x11'
build_platform('x11',
uselib=['M', 'X11', 'XSYNC', 'XCURSOR', 'XRANDR'],
- source=lib_source + ['include/pugl/detail/x11.c'])
+ source=lib_source + ['src/x11.c'])
build_backend('x11', 'stub',
uselib=['X11'],
- source=['include/pugl/detail/x11_stub.c'])
+ source=['src/x11_stub.c'])
if bld.env.HAVE_GL:
glx_lib = 'GLX' if bld.env.LIB_GLX else 'GL'
build_backend('x11', 'gl',
uselib=[glx_lib, 'X11'],
- source=['include/pugl/detail/x11_gl.c'])
+ source=['src/x11_gl.c'])
if bld.env.HAVE_VULKAN:
build_backend('x11', 'vulkan',
uselib=['DL', 'X11'],
- source=['include/pugl/detail/x11_vulkan.c',
- 'include/pugl/detail/x11_stub.c'])
+ source=['src/x11_vulkan.c', 'src/x11_stub.c'])
if bld.env.HAVE_CAIRO:
build_backend('x11', 'cairo',
uselib=['CAIRO', 'X11'],
- source=['include/pugl/detail/x11_cairo.c',
- 'include/pugl/detail/x11_stub.c'])
+ source=['src/x11_cairo.c', 'src/x11_stub.c'])
def build_example(prog, source, platform, backend, **kwargs):
lang = 'cxx' if source[0].endswith('.cpp') else 'c'
@@ -695,9 +684,9 @@ def lint(ctx):
"-Xiwyu", "--check_also=pugl/*.h",
"-Xiwyu", "--check_also=pugl/*.hpp",
"-Xiwyu", "--check_also=pugl/*.ipp",
- "-Xiwyu", "--check_also=pugl/detail/*.c",
- "-Xiwyu", "--check_also=pugl/detail/*.h",
- "-Xiwyu", "--check_also=pugl/detail/*.m"]
+ "-Xiwyu", "--check_also=src/*.c",
+ "-Xiwyu", "--check_also=src/*.h",
+ "-Xiwyu", "--check_also=src/*.m"]
output = subprocess.check_output(cmd).decode('utf-8')
if 'error: ' in output:
sys.stdout.write(output)