Skip to content

Commit bd87c37

Browse files
committed
first successful open62541/libsigcpp/caf build
1 parent 8c87c4b commit bd87c37

File tree

8 files changed

+8455
-42
lines changed

8 files changed

+8455
-42
lines changed

ChangeLog

Lines changed: 8421 additions & 2 deletions
Large diffs are not rendered by default.

MSVC_NMake/meson.build

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# MSVC_NMake
22

3-
# Input: pkg_conf_data, sigcxxconfig_h, project_build_root, python3
4-
# Output: sigc_rc
3+
# Input: pkg_conf_data, project_build_root, python3
4+
# Output: -
55

66
sigc_rc = configure_file(
77
input: 'sigc.rc.in',
@@ -10,11 +10,11 @@ sigc_rc = configure_file(
1010
)
1111

1212
# Copy the generated configuration header into the MSVC project directory.
13-
configure_file(
14-
input: sigcxxconfig_h,
15-
output: 'sigc++config.h',
16-
copy: true,
17-
)
13+
cmd_py = '''
14+
import shutil
15+
shutil.copy2("@0@", "@1@")
16+
'''.format(project_build_root / 'sigc++config.h', project_build_root / 'MSVC_NMake')
17+
meson.add_postconf_script(python3.path(), '-c', cmd_py)
1818

1919
untracked_msvc_nmake = 'untracked' / 'MSVC_NMake'
2020
handle_built_files = project_source_root / 'tools' / 'handle-built-files.py'
@@ -24,10 +24,10 @@ if not meson.is_subproject()
2424
# (add_dist_script() is not allowed in a subproject)
2525

2626
meson.add_dist_script(
27+
python3.path(), dist_cmd,
2728
python3.path(), handle_built_files, 'dist_gen_msvc_files',
2829
meson.current_build_dir(),
2930
untracked_msvc_nmake,
30-
project_build_root / 'sigc++config.h',
31-
meson.current_build_dir() / 'sigc.rc',
31+
project_build_root / 'sigc++config.h', meson.current_build_dir() / 'sigc.rc',
3232
)
3333
endif

Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ EXTRA_DIST = \
5555
examples/meson.build \
5656
sigc++/meson.build \
5757
tests/meson.build \
58+
tools/dist-cmd.py \
5859
tools/handle-built-files.py \
5960
tools/tutorial-custom-cmd.py \
6061
untracked/README

docs/docs/manual/meson.build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# docs/docs/manual
22

33
# input: install_datadir, sigcxx_pcname, tutorial_custom_cmd, python3,
4-
# build_documentation, book_name
4+
# build_documentation, dist_cmd, book_name
55
# output: can_parse_and_validate, build_pdf_by_default, can_build_pdf,
66
# install_tutorialdir
77

@@ -81,6 +81,7 @@ if not meson.is_subproject()
8181
# Distribute built files.
8282
# (add_dist_script() is not allowed in a subproject)
8383
meson.add_dist_script(
84+
python3.path(), dist_cmd,
8485
python3.path(), tutorial_custom_cmd, 'dist_doc',
8586
doc_dist_dir,
8687
meson.current_build_dir(),

docs/docs/reference/meson.build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Input: project_build_root, project_source_root, sigcxx_pcname,
44
# sigcxx_api_version, perl, build_documentation, source_h_files,
5-
# hg_ccg_basenames, install_datadir, python3, doc_reference
5+
# hg_ccg_basenames, install_datadir, dist_cmd, python3
66
# Output: install_docdir, install_devhelpdir, book_name
77

88
# There are no built source files in libsigc++-3.0.
@@ -115,6 +115,7 @@ if not meson.is_subproject()
115115
# Distribute built files and files copied by mm-common-get.
116116
# (add_dist_script() is not allowed in a subproject)
117117
meson.add_dist_script(
118+
python3.path(), dist_cmd,
118119
python3.path(), doc_reference, 'dist_doc',
119120
doctool_dir,
120121
doctool_dist_dir,

meson.build

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,11 @@ sys.exit(os.path.isdir("@0@") or os.path.isfile("@0@"))
5656
'''.format(project_source_root / '.git')
5757
is_git_build = run_command(python3, '-c', cmd_py).returncode() != 0
5858

59-
# Are we testing a dist tarball while it's being built?
60-
# There ought to be a better way. https://github.com/mesonbuild/meson/issues/6866
61-
is_dist_check = project_source_root.contains('dist-unpack') and \
62-
project_build_root.contains('dist-build')
63-
6459
# Options.
6560
maintainer_mode_opt = get_option('maintainer-mode')
6661
maintainer_mode = maintainer_mode_opt == 'true' or \
6762
(maintainer_mode_opt == 'if-git-build' and is_git_build)
68-
if is_dist_check
69-
message('Looks like a tarball is being tested. ' + \
70-
'Option "dist-warnings" is used instead of "warnings".')
71-
warning_level = get_option('dist-warnings')
72-
else
73-
warning_level = get_option('warnings')
74-
endif
63+
warning_level = get_option('warnings')
7564
build_deprecated_api = get_option('build-deprecated-api')
7665
build_documentation_opt = get_option('build-documentation')
7766
build_documentation = build_documentation_opt == 'true' or \
@@ -121,23 +110,13 @@ script_dir = project_source_root / 'untracked' / 'build_scripts'
121110
doc_reference = script_dir / 'doc-reference.py'
122111
dist_changelog = script_dir / 'dist-changelog.py'
123112
dist_build_scripts = script_dir / 'dist-build-scripts.py'
113+
dist_cmd = project_source_root / 'tools' / 'dist-cmd.py' # Must be committed to git.
124114
tutorial_custom_cmd = project_source_root / 'tools' / 'tutorial-custom-cmd.py'
125115

126-
if maintainer_mode
116+
if maintainer_mode and mm_common_get.found()
127117
# Copy files to untracked/build_scripts and untracked/docs/docs.
128118
run_command(mm_common_get, '--force', script_dir,
129119
project_source_root / 'untracked' / 'docs' / 'docs')
130-
else
131-
cmd_py = '''
132-
import os
133-
import sys
134-
sys.exit(os.path.isfile("@0@"))
135-
'''.format(doc_reference)
136-
file_exists = run_command(python3, '-c', cmd_py).returncode() != 0
137-
if not file_exists
138-
warning('Missing files in untracked/. ' + \
139-
'Enable maintainer-mode if you want to build documentation or create a dist tarball.')
140-
endif
141120
endif
142121

143122
# Set compiler warnings.
@@ -208,7 +187,7 @@ configure_file(
208187
)
209188

210189
install_includeconfigdir = install_libdir / sigcxx_pcname / 'include'
211-
sigcxxconfig_h = configure_file(
190+
configure_file(
212191
input: 'sigc++config.h.meson',
213192
output: 'sigc++config.h',
214193
configuration: pkg_conf_data,
@@ -227,12 +206,14 @@ if not meson.is_subproject()
227206
# Add a ChangeLog file to the distribution directory.
228207
# (add_dist_script() is not allowed in a subproject)
229208
meson.add_dist_script(
209+
python3.path(), dist_cmd,
230210
python3.path(), dist_changelog,
231211
project_source_root,
232212
)
233213
# Add build scripts to the distribution directory, and delete .gitignore
234214
# files and an empty $MESON_DIST_ROOT/build/ directory.
235215
meson.add_dist_script(
216+
python3.path(), dist_cmd,
236217
python3.path(), dist_build_scripts,
237218
project_source_root,
238219
'untracked' / 'build_scripts',

meson_options.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
option('maintainer-mode', type: 'combo', choices: ['false', 'if-git-build', 'true'],
2-
value: 'if-git-build', description: 'Let mm-common-get copy some files to untracked/')
2+
value: 'if-git-build', description: 'Generate source code from .hg and .ccg files')
33
option('warnings', type: 'combo', choices: ['no', 'min', 'max', 'fatal'],
4-
value: 'min', description: 'Compiler warning level')
5-
option('dist-warnings', type: 'combo', choices: ['no', 'min', 'max', 'fatal'],
6-
value: 'fatal', description: 'Compiler warning level when a tarball is created')
4+
value: 'fatal', description: 'Compiler warning level')
75
option('build-deprecated-api', type: 'boolean', value: true,
86
description: 'Build deprecated API and include it in the library')
97
option('build-documentation', type: 'combo', choices: ['false', 'if-maintainer-mode', 'true'],

tools/dist-cmd.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env python3
2+
3+
# External command, intended to be called with meson.add_dist_script() in meson.build.
4+
# meson.add_dist_script() can't call a script that's not committed to git.
5+
# This script shall be committed. It can be used for calling other non-committed scripts.
6+
7+
# dist-cmd.py <cmd> <args>...
8+
9+
import sys
10+
import subprocess
11+
12+
sys.exit(subprocess.run(sys.argv[1:]).returncode)

0 commit comments

Comments
 (0)