Skip to content

Commit b547861

Browse files
thiblahuteaperezdc
authored andcommitted
Fix using libwpe as meson subproject
We basically need to make sure that both `<builddir>/include>` and `include/` are usable as include directory and we need to avoid exposing the directory with `version.h` to the outside world when linking as a subproject as that clashes easily (at least with wpeframework-fdo).
1 parent 8cce32d commit b547861

File tree

6 files changed

+43
-40
lines changed

6 files changed

+43
-40
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ add_library(wpe SHARED
8181
target_include_directories(wpe PRIVATE
8282
"include"
8383
"src"
84-
${DERIVED_SOURCES_DIR}
84+
${DERIVED_SOURCES_DIR}/..
8585
$<TARGET_PROPERTY:GL::egl,INTERFACE_INCLUDE_DIRECTORIES>
8686
)
8787
target_compile_definitions(wpe PRIVATE

include/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
subdir('wpe')

include/wpe/meson.build

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
api_headers = [
2+
'export.h',
3+
'input.h',
4+
'keysyms.h',
5+
'loader.h',
6+
'pasteboard.h',
7+
'renderer-backend-egl.h',
8+
'renderer-host.h',
9+
'view-backend.h',
10+
'wpe-egl.h',
11+
'wpe.h',
12+
13+
# Generated API headers.
14+
configure_file(
15+
input: 'version.h.cmake',
16+
output: 'version.h',
17+
configuration: version_info,
18+
),
19+
configure_file(
20+
input: 'version-deprecated.h.cmake',
21+
output: 'version-deprecated.h',
22+
configuration: version_info,
23+
),
24+
]
25+
install_headers(api_headers,
26+
subdir: join_paths('wpe-' + api_version, 'wpe'),
27+
)
28+

include/wpe/wpe.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@
3434

3535
#define __WPE_H_INSIDE__
3636

37-
#include "export.h"
38-
#include "input.h"
39-
#include "keysyms.h"
40-
#include "loader.h"
41-
#include "pasteboard.h"
42-
#include "renderer-host.h"
43-
#include "version.h"
44-
#include "version-deprecated.h"
45-
#include "view-backend.h"
37+
#include "wpe/export.h"
38+
#include "wpe/input.h"
39+
#include "wpe/keysyms.h"
40+
#include "wpe/loader.h"
41+
#include "wpe/pasteboard.h"
42+
#include "wpe/renderer-host.h"
43+
#include "wpe/version.h"
44+
#include "wpe/version-deprecated.h"
45+
#include "wpe/view-backend.h"
4646

4747
#undef __WPE_H_INSIDE__
4848

meson.build

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -90,36 +90,10 @@ libwpe = library('wpe-' + api_version,
9090
soversion: soversion_major,
9191
include_directories: 'include',
9292
gnu_symbol_visibility: 'hidden',
93+
include_directories : [include_directories('include')],
9394
)
9495

95-
api_headers = [
96-
'include/wpe/export.h',
97-
'include/wpe/input.h',
98-
'include/wpe/keysyms.h',
99-
'include/wpe/loader.h',
100-
'include/wpe/pasteboard.h',
101-
'include/wpe/renderer-backend-egl.h',
102-
'include/wpe/renderer-host.h',
103-
'include/wpe/view-backend.h',
104-
'include/wpe/wpe-egl.h',
105-
'include/wpe/wpe.h',
106-
107-
# Generated API headers.
108-
configure_file(
109-
input: 'include/wpe/version.h.cmake',
110-
output: 'version.h',
111-
configuration: version_info,
112-
),
113-
configure_file(
114-
input: 'include/wpe/version-deprecated.h.cmake',
115-
output: 'version-deprecated.h',
116-
configuration: version_info,
117-
),
118-
]
119-
install_headers(api_headers,
120-
subdir: join_paths('wpe-' + api_version, 'wpe'),
121-
)
122-
96+
subdir('include')
12397
import('pkgconfig').generate(
12498
description: 'The wpe library',
12599
name: 'wpe-' + api_version,

src/version.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2525
*/
2626

27-
#include "version.h"
28-
#include "version-deprecated.h"
27+
#include "wpe/version.h"
28+
#include "wpe/version-deprecated.h"
2929

3030
unsigned
3131
wpe_get_major_version(void)

0 commit comments

Comments
 (0)