277 Commits

Author SHA1 Message Date
Stone Tickle
6ed33c72a2
better linker detection and usage
Adds support for using msvc, as well as a proper detection step for
linkers.  Static and shared linkers are both tied to the compiler object
for now.
2024-02-09 20:13:44 -05:00
Vincent Torri
9d16636042 Windows: add str_endswithi() for compiler_cl_args_output()
also added references in meson to check if it is
compatible with meson
2024-02-02 09:49:47 -05:00
Stone Tickle
0f22851a0a
ignore leading/trailing whitespace in str.to_int()
This is what meson does and seems reasonable.
2024-01-07 13:05:05 -05:00
Stone Tickle
802d17bd06
add -Wno-redirect-script-error to analyzer
This helps when debugging script modules
2024-01-02 12:05:42 -05:00
Stone Tickle
95e20fdb8b
error on multiple project() calls 2024-01-02 12:03:02 -05:00
Stone Tickle
bb0927c7e7
remove unused function 2024-01-02 08:02:26 -05:00
Stone Tickle
446122b154
add str_eql_glob 2024-01-01 21:58:12 -05:00
Stone Tickle
0b860734a3
make analyzer a little smarter about returns
The return will actually return if the codepath it was reached by is
entirely pure.  This will likely need tweaking but it works well for
simple cases.
2023-12-31 20:01:13 -05:00
Stone Tickle
769f0d508a
improve function typechecking function analysis
Functions are now analyzed when they are defined so they aren't
erroneously marked as dead code.  This led to some weird typechecking
issues that ended up pushing me to clean up some of the typechecking
code.
2023-12-30 14:20:16 -05:00
Stone Tickle
c9896c1751
rename ARG_TYPE_GLOB/ARG_TYPE_ARRAY_OF
the new names are TYPE_TAG_GLOB TYPE_TAG_LISTIFY which better reflect
that they are type "tags" (i.e. not real types) and line up with the
typechecking syntax naming
2023-12-16 20:06:52 -05:00
Stone Tickle
55816e413d
replace old nested typechecking with new system
I didn't update message() though because technically the type signature
is recursive and we don't have a way to represent that.
2023-12-16 20:03:12 -05:00
Stone Tickle
97ba99ade9
update type system to support nested types
These new types are supported in the typechecker as well as the script
module syntax.
2023-12-16 12:07:40 -05:00
Stone Tickle
de372bafd5
support type annotations in script 2023-12-12 16:03:42 -05:00
Stone Tickle
3ddf339d4a
remove usage of strncasecmp 2023-12-11 20:58:07 -05:00
Stone Tickle
c9a556b197
fix name and type_name for not found dependencies 2023-12-08 10:38:52 -05:00
Stone Tickle
b9b305dd17
remove local keyword 2023-12-06 21:39:23 -05:00
Stone Tickle
d9388848eb
add analyze -d 2023-12-06 16:37:15 -05:00
Stone Tickle
8973302295
add analyze -t 2023-12-06 16:36:26 -05:00
Stone Tickle
ed4e516dc7
reimplement dict_del 2023-12-06 16:31:51 -05:00
Stone Tickle
0010f5f451
wip optimize dicts with hash map backing 2023-12-06 09:10:00 -05:00
Stone Tickle
883594c470
reuse identical strings 2023-12-04 21:17:26 -05:00
Stone Tickle
acd88ddf23
add dict delete 2023-11-30 13:12:20 -05:00
Stone Tickle
d7dff4b44c
obj array more functions and fix when deleting end 2023-11-29 22:26:21 -05:00
Stone Tickle
b6545fc75e
make logging objects easier 2023-11-29 22:25:33 -05:00
Stone Tickle
4a79d17741
more scope work 2023-11-28 11:40:15 -05:00
Stone Tickle
7e99abc43e
working on scopes 2023-11-27 21:29:17 -05:00
Stone Tickle
9cb9d858c9
lots of small changes
- wip "unencapsulated" module.  This just means that the module is
  loaded into the global scope.  You could then write functions like
  `vcs_tag` in this global module to be used by all meson files.  This
  might be removed.
- remove export() function and instead use a lua-like return to export
  from the module.
- track language mode in function definitions.  Necessary for functions
  to use internal-only functions.
- use assigned function name in error messages
- fix embedded source reopening in error messages
- reduce number of node types that get marked as dead code
- create true/false bools on workspace initialization with known ids.
  Future code should use these rather than making new boolean objects to
  save memory.
- add a new test script-module
2023-11-27 12:45:53 -05:00
Stone Tickle
2afcdbdacb
restrict modules to embedded modules
also alter function syntax
2023-11-25 20:45:55 -05:00
Stone Tickle
0deb94b745
add extended lang mode 2023-11-19 20:37:31 -05:00
Stone Tickle
5e1c455cbc
more progress 2023-11-17 22:39:51 -05:00
Stone Tickle
4a0272972e
more flexible functions 2023-11-15 21:54:30 -05:00
Stone Tickle
949c2cf44c
rename datastructures 2023-11-12 11:04:23 -05:00
Stone Tickle
6416305a94
reformat and fix issues with python module changes
- fix python3.find_python return type
- fix missing interp_args for language_version()
- add missing run_cmd_ctx_destroy
2023-10-19 22:34:37 -04:00
Filipe Laíns
118134e531
python: implement python_installation.language_version
Signed-off-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Seedo Paul <seedoeldhopaul@gmail.com>
2023-10-19 22:33:54 -04:00
Filipe Laíns
50ce7d9053
object: add python_installation
python_installation is an external_program with a couple of extra
methods related to the Python installation. Right now, we only add the
type.

Signed-off-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Seedo Paul <seedoeldhopaul@gmail.com>
2023-10-19 22:33:54 -04:00
Stone Tickle
074f34e91c
support cmd_array for external_program
This will be required for find_program('meson') to return an external
program with the command ['muon', 'meson'].  It also allows muon to
return ['muon', 'samu'] as the result for find_program('ninja'), which
is kind of neat.
2023-10-09 10:04:57 -04:00
Stone Tickle
d2966a3f4c
implement project(license_files:) 2023-10-03 13:35:25 -04:00
Stone Tickle
5de4d811b7
implement declare_dependency(objects:) 2023-10-03 13:35:25 -04:00
Stone Tickle
dc432474c0
muon fmt: editorconfig support 2023-04-24 19:40:10 -04:00
Stone Tickle
6c0547b470
automatically unprefix build dir options
The invocation:

meson setup -Dlibdir=/usr/lib64 -Dprefix=/usr build

sets libdir to `lib64` because meson detects that it is an absolute path
that is a subdir of prefix.  This commit adds the same functionality to
muon.
2023-04-07 06:44:36 -04:00
Stone Tickle
b60b51965f
attempt to chdir to project root when -O is passed 2023-03-15 13:37:09 -04:00
Stone Tickle
40171e7e94
add quiet mode for parser 2023-03-15 13:36:42 -04:00
Stone Tickle
3f765c6a53
add -i flag to analyze muon internal eval files 2023-03-15 13:30:54 -04:00
Stone Tickle
d286201f39
rename posix.h to compat.h
Currently all compat.h does is define the appropriate POSIX macro unless
you are on windows, as well as conditionally enabling
__attribute__(format...).
2023-03-10 09:35:04 -05:00
Stone Tickle
22c1d334af
analyzer: replace -u with -Werror 2023-02-27 10:44:54 -05:00
Stone Tickle
73a26346c8
make dead code warning non-fatal 2023-02-27 10:36:09 -05:00
Stone Tickle
ba48defcd9
make the analyzer smarter 2023-02-26 22:27:14 -05:00
Stone Tickle
640b16bdd7
support custom_target depfiles 2023-01-29 11:56:55 -05:00
Stone Tickle
9c3cbb8804
add experimental meson cli compatibility layer 2023-01-23 22:09:00 -05:00
Stone Tickle
14dda5e9c5
add basic support for appleframeworks dependency 2023-01-17 20:32:00 -05:00