Selaa lähdekoodia

meson: build/install openhmd.pc and header in static lib

Generate the openhmd.pc pkgconfig file and install it and the openhmd.h
header even when building a static library.
Alexandre Janniaux 6 vuotta sitten
vanhempi
commit
a5c3baeaa6
1 muutettua tiedostoa jossa 13 lisäystä ja 12 poistoa
  1. 13 12
      meson.build

+ 13 - 12
meson.build

@@ -107,7 +107,7 @@ endif
 
 openhmd_lib = library('openhmd', sources, include_directories : include_directories('./include'), c_args : c_args, dependencies : deps, install : true, version : library_version)
 
-# build examples and install pkg-config file + header only for shared library. shared is the default
+# build examples only for shared library. shared is the default
 if get_option('default_library') == 'shared'
 	_examples = get_option('examples')
 	if _examples.contains('simple')
@@ -124,15 +124,16 @@ if get_option('default_library') == 'shared'
 		glewdep = dependency('glew')
 		executable('openhmd_opengl_example', opengl_sources , include_directories : include_directories(['./include', 'examples/opengl']), link_with: [openhmd_lib], dependencies : [sdldep, gldep, glewdep], install : true)
 	endif
-	pkg = import('pkgconfig')
-	pkg.generate(
-		name : 'openhmd',
-		description : 'API and drivers for immersive technology devices such as HMDs',
-		version : meson.project_version(),
-		subdirs : 'openhmd',
-		requires : hidapi,
-		libraries : openhmd_lib,
-		url : 'http://www.openhmd.net/'
-	)
-	install_headers('include/openhmd.h', subdir : 'openhmd')
 endif
+
+pkg = import('pkgconfig')
+pkg.generate(
+	name : 'openhmd',
+	description : 'API and drivers for immersive technology devices such as HMDs',
+	version : meson.project_version(),
+	subdirs : 'openhmd',
+	requires : hidapi,
+	libraries : openhmd_lib,
+	url : 'http://www.openhmd.net/'
+)
+install_headers('include/openhmd.h', subdir : 'openhmd')