Skip to content

Commit 2a38752

Browse files
ircclient wrap
Needed for windows build
1 parent c42d343 commit 2a38752

File tree

5 files changed

+181
-1
lines changed

5 files changed

+181
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,5 @@ $RECYCLE.BIN/
103103

104104
# meson
105105
subprojects/*
106+
!subprojects/packagefiles
106107
!subprojects/*.wrap

source/glest_game/meson.build

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ inc_game = [
110110
game_deps = []
111111

112112
inc_ircclient = []
113-
irclient_dep = []
114113
ircclient_dep = dependency('ircclient', required: false)
115114
if not ircclient_dep.found()
116115
ircclient_dep = cc.find_library(
@@ -120,7 +119,9 @@ if not ircclient_dep.found()
120119
)
121120
if not ircclient_dep.found()
122121
inc_ircclient = ['/usr/include', '/usr/local/include']
122+
# Header location on Arch based systems.
123123
path = '/usr/include/libircclient'
124+
# Check if the directory exists, otherwise meson will throw an error.
124125
result = run_command('test', '-d', path, check: false)
125126
if result.returncode() == 0
126127
inc_ircclient += path
@@ -130,7 +131,18 @@ if not ircclient_dep.found()
130131
dirs: '/usr/local/lib',
131132
has_headers: 'libircclient.h',
132133
header_include_directories: include_directories(inc_ircclient),
134+
required: false,
133135
)
136+
137+
if not ircclient_dep.found()
138+
# This will use the fallback.
139+
ircclient_dep = dependency(
140+
'ircclient',
141+
required: true,
142+
fallback: 'ircclient',
143+
default_options: ['default_library=static']
144+
)
145+
endif
134146
endif
135147
endif
136148

subprojects/ircclient.wrap

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[wrap-file]
2+
directory = libircclient-1.10
3+
source_url = https://sourceforge.net/projects/libircclient/files/libircclient-1.10.tar.gz
4+
source_filename = libircclient-1.10.tar.gz
5+
source_hash = bbb26f3af348b252c5204917a7f91cfdf172f1b6afbf4df1e561b03e20503c2d
6+
patch_directory = ircclient
7+
8+
[provide]
9+
ircclient = ircclient_dep
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
project(
2+
'ircclient',
3+
'c',
4+
version: '1.10.05',
5+
meson_version : '>= 0.48.0',
6+
default_options: [
7+
'warning_level=2',
8+
]
9+
)
10+
11+
cc = meson.get_compiler('c')
12+
extra_flags = [
13+
'-fno-common',
14+
'-Wshadow',
15+
'-Wstrict-overflow=5',
16+
'-Wformat-security',
17+
'-Wformat-overflow=2',
18+
'-Wunused-result',
19+
'-Werror=odr',
20+
'-Werror=lto-type-mismatch',
21+
'-Werror=strict-aliasing',
22+
]
23+
24+
add_project_arguments(cc.get_supported_arguments(extra_flags), language: 'c')
25+
26+
inc = include_directories('include')
27+
28+
src = ('src/libircclient.c')
29+
buildtarget = library(
30+
meson.project_name(),
31+
src,
32+
include_directories : inc,
33+
version : meson.project_version(),
34+
install: not meson.is_subproject()
35+
)
36+
37+
# How to use in a superproject and other info
38+
# https://mesonbuild.com/Subprojects.html
39+
ircclient_dep = declare_dependency(
40+
include_directories : inc,
41+
link_with : buildtarget
42+
)
43+
44+
if not meson.is_subproject()
45+
pkg = import('pkgconfig')
46+
pkg.generate(
47+
buildtarget,
48+
description : 'Simple irc client')
49+
endif
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
/* include/config.h.in. Generated from configure.in by autoheader. */
2+
3+
/* Define to 1 if you have the `getaddrinfo' function. */
4+
#undef HAVE_GETADDRINFO
5+
6+
/* Define to 1 if you have the `gethostbyname_r' function. */
7+
#undef HAVE_GETHOSTBYNAME_R
8+
9+
/* Define to 1 if you have the `inet_ntoa' function. */
10+
#undef HAVE_INET_NTOA
11+
12+
/* Define to 1 if you have the `inet_pton' function. */
13+
#undef HAVE_INET_PTON
14+
15+
/* Define to 1 if you have the <inttypes.h> header file. */
16+
#undef HAVE_INTTYPES_H
17+
18+
/* Define to 1 if you have the `localtime_r' function. */
19+
#undef HAVE_LOCALTIME_R
20+
21+
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
22+
to 0 otherwise. */
23+
#undef HAVE_MALLOC
24+
25+
/* Define to 1 if you have the <memory.h> header file. */
26+
#undef HAVE_MEMORY_H
27+
28+
/* Define to 1 if you have the `socket' function. */
29+
#undef HAVE_SOCKET
30+
31+
/* Define to 1 if `stat' has the bug that it succeeds when given the
32+
zero-length file name argument. */
33+
#undef HAVE_STAT_EMPTY_STRING_BUG
34+
35+
/* Define to 1 if stdbool.h conforms to C99. */
36+
#undef HAVE_STDBOOL_H
37+
38+
/* Define to 1 if you have the <stdint.h> header file. */
39+
#undef HAVE_STDINT_H
40+
41+
/* Define to 1 if you have the <stdlib.h> header file. */
42+
#undef HAVE_STDLIB_H
43+
44+
/* Define to 1 if you have the <strings.h> header file. */
45+
#undef HAVE_STRINGS_H
46+
47+
/* Define to 1 if you have the <string.h> header file. */
48+
#undef HAVE_STRING_H
49+
50+
/* Define to 1 if you have the <sys/select.h> header file. */
51+
#undef HAVE_SYS_SELECT_H
52+
53+
/* Define to 1 if you have the <sys/socket.h> header file. */
54+
#undef HAVE_SYS_SOCKET_H
55+
56+
/* Define to 1 if you have the <sys/stat.h> header file. */
57+
#undef HAVE_SYS_STAT_H
58+
59+
/* Define to 1 if you have the <sys/types.h> header file. */
60+
#undef HAVE_SYS_TYPES_H
61+
62+
/* Define to 1 if you have the <unistd.h> header file. */
63+
#undef HAVE_UNISTD_H
64+
65+
/* Define to 1 if the system has the type `_Bool'. */
66+
#undef HAVE__BOOL
67+
68+
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
69+
slash. */
70+
#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
71+
72+
/* Define to the address where bug reports for this package should be sent. */
73+
#undef PACKAGE_BUGREPORT
74+
75+
/* Define to the full name of this package. */
76+
#undef PACKAGE_NAME
77+
78+
/* Define to the full name and version of this package. */
79+
#undef PACKAGE_STRING
80+
81+
/* Define to the one symbol short name of this package. */
82+
#undef PACKAGE_TARNAME
83+
84+
/* Define to the version of this package. */
85+
#undef PACKAGE_VERSION
86+
87+
/* Define to the type of arg 1 for `select'. */
88+
#undef SELECT_TYPE_ARG1
89+
90+
/* Define to the type of args 2, 3 and 4 for `select'. */
91+
#undef SELECT_TYPE_ARG234
92+
93+
/* Define to the type of arg 5 for `select'. */
94+
#undef SELECT_TYPE_ARG5
95+
96+
/* Define to 1 if you have the ANSI C header files. */
97+
#undef STDC_HEADERS
98+
99+
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
100+
#undef TIME_WITH_SYS_TIME
101+
102+
/* Define to empty if `const' does not conform to ANSI C. */
103+
#undef const
104+
105+
/* Define to rpl_malloc if the replacement function should be used. */
106+
#undef malloc
107+
108+
/* Define to `unsigned int' if <sys/types.h> does not define. */
109+
#undef size_t

0 commit comments

Comments
 (0)