Explicitly cast interchangable but distinct enum types
[helenos.git] / meson.build
blobd28c14051d16d30585feb89afb79a7eed1948341
2 # Copyright (c) 2019 Jiří Zárevúcky
3 # All rights reserved.
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
7 # are met:
9 # - Redistributions of source code must retain the above copyright
10 #   notice, this list of conditions and the following disclaimer.
11 # - Redistributions in binary form must reproduce the above copyright
12 #   notice, this list of conditions and the following disclaimer in the
13 #   documentation and/or other materials provided with the distribution.
14 # - The name of the author may not be used to endorse or promote products
15 #   derived from this software without specific prior written permission.
17 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 # TODO: Use vcs_tag() to generate version string
30 # TODO: jobfile
31 # TODO: lto in uspace
32 # TODO: fix clang build
34 project(
35     'HelenOS',
36     [ 'c', 'cpp' ],
37     default_options : ['buildtype=plain', 'c_std=gnu11', 'cpp_std=c++17', 'warning_level=2', 'werror=false', 'b_staticpic=false', 'prefix=/' ],
38     meson_version: '>=0.55.0',
41 debug_options = false
42 debug_shell_scripts = false
44 subdir('meson/part/tools')
45 subdir('meson/part/read_config')
46 subdir('meson/part/compiler_args')
47 subdir('meson/part/initrd_manifest')
48 subdir('meson' / 'arch' / UARCH)
50 ## The at-sign
52 # The `atsign` variable holds the ASCII character representing the at-sign
53 # ('@') used in various $(AS) constructs (e.g. @progbits). On architectures that
54 # don't use '@' for starting a comment, `atsign` is merely '@'. However, on
55 # those that do use it for starting a comment (e.g. arm32), `atsign` must be
56 # defined as the percentile-sign ('%') in the architecture-dependent files.
58 if not is_variable('atsign')
59         atsign = '@'
60 endif
62 ## Some architectures need a particular string at the beginning of assembly files.
63 if not is_variable('kernel_as_prolog')
64         kernel_as_prolog = ''
65 endif
66 if not is_variable('uspace_as_prolog')
67         uspace_as_prolog = ''
68 endif
70 # The following variables are filled in by code in the kernel and uspace subdirs.
72 # References to the actual binary artefacts that will be part of initrd image.
73 rd_init_binaries = []
74 # Installed files.
75 install_files = []
76 install_deps = []
77 # Install script for headers.
78 # TODO: Make a list of directories and turn into script later.
79 uspace_lib_install_script_text = []
81 subdir('kernel')
82 subdir('uspace')
84 subdir('meson/part/exports')
85 subdir('meson/part/initrd')
87 subdir('boot')
89 # Copy the final image to the build root,
90 # and write its name to a text file `image_path`.
92 if is_variable('POST_INPUT')
93         image = custom_target(POST_OUTPUT,
94                 output: POST_OUTPUT,
95                 input: POST_INPUT,
96                 command: [ cp, '@INPUT@', '@OUTPUT@' ],
97         )
99         custom_target('image_path',
100                 output: 'image_path',
101                 input: image,
102                 command: [ 'echo', '@INPUT@' ],
103                 capture: true,
104         )
105 else
106         custom_target('image_path',
107                 output: 'image_path',
108                 command: [ 'echo' ],
109                 capture: true,
110         )
111 endif
113 subdir('meson/part/extra_targets')