Commit Graph

104 Commits

Author SHA1 Message Date
Mads Kiilerich 6b61b03434 wscript: drop traces of shutdown() handling
autowaf has no real shutdown functionality anyway. The automatic
shutdown function that could have been called wouldn't work anyway, as
it takes an argument.

The only reason it doesn't fail is that the top level wscript has no
shutdown handling and doesn't recurse to other scripts, so it is all
dead code.
2023-10-15 10:47:16 -06:00
Mads Kiilerich 88cecdfaef wscript: drop repeated autowaf.set_options - it is enough to set at top level 2023-10-15 10:47:16 -06:00
Robin Gareus 2b0bb54599
Update LuaState API (4/4)
Now that all calls use explicit parameters, we can remove
the default params, and make ::sandbox() private
2023-10-04 02:50:44 +02:00
Robin Gareus 7c10a54334
Prepare for explicit Lua Sandboxing (API update) 1/4 2023-10-04 02:46:58 +02:00
Mads Kiilerich d220f477ed wscript: drop unused "mandatory variables" 'top' and 'out' in libs
Variables by these names are only used from the local wscript and when
running "waf configure", which already for other reasons only can run at
the top-level.

These variables are thus not mandatory and not used.
2023-09-17 07:34:55 -06:00
Mads Kiilerich a0916ef368 wscript: drop unused APPNAME assignment in libs
https://waf.io/book/ says
  By default, the project name and version are set to noname and 1.0. To
  change them, it is necessary to provide two additional variables in
  the top-level project file

- and waf code inspection confirms that waf itself only will use the top
level APPNAME.

Also, the 'waf dist' comment doesn't seem relevant - especially after
this change - and is removed too.

(Note: libs/evoral/wscript and libs/temporal/wscript still use APPNAME
for other purposes.)
2023-09-17 07:34:55 -06:00
Mads Kiilerich 3b4cf9191c wscript: drop unused VERSION assignment in libs
https://waf.io/book/ says
  By default, the project name and version are set to noname and 1.0. To
  change them, it is necessary to provide two additional variables in the
  top-level project file

- and waf code inspection confirms that waf itself only will use the top
  level VERSION.

Some wscripts will use
  bld.env['VERSION']
but that will also just use the value set in the top wscript.
2023-09-17 07:34:55 -06:00
Mads Kiilerich 7737c17d52 wscript: drop unused imports, scripted
Done with ad hoc scripting hacks processing unused imports found by pyflakes:

for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Logs.* but unused' | cut -d: -f1 | while read f; do sed -i 's/^import waflib.Logs as Logs,/import/g' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Options.* but unused' | cut -d: -f1 | while read f; do sed -i 's/import waflib.Options as Options, /import /g' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Options.* but unused' | cut -d: -f1 | while read f; do sed -i 's/^from waflib import Options,/from waflib import/g' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep ' imported but unused$' | sed "s/^\([^:]*\):[0-9]*:[0-9]* '\(.*\)'.*/\1 \2/g" | while read f lib; do sed -i "/^import $lib$/d" $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Options.* but unused' | cut -d: -f1 | while read f; do sed -i '/from waflib import Options$/d' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.TaskGen.* but unused' | cut -d: -f1 | while read f; do sed -i '/from waflib import TaskGen$/d' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Task.Task.* but unused' | cut -d: -f1 | while read f; do sed -i '/^from waflib.Task import Task$/d' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Tools.winres.* but unused' | cut -d: -f1 | while read f; do sed -i '/^from waflib.Tools import winres$/d' $f; done
for f in $( find * -name wscript ); do echo; pyflakes $f; done | grep 'waflib.Utils.* but unused' | cut -d: -f1 | while read f; do sed -i '/^import waflib.Utils as Utils$/d' $f; done
2023-09-17 07:34:55 -06:00
Robin Gareus f2c5f9da25
Lua: allow to reserve STL vector size 2023-07-12 18:23:51 +02:00
Robin Gareus 5bbd248384
Add Lua bindings for std::list/vector clear 2023-05-13 17:38:41 +02:00
Robin Gareus 7094c82e75
Add Lua bindings to std::shared_ptr<T const>
This is required after the recent RCU change to return
const shared pointers for read (295dbd8e1).
2023-04-19 01:46:58 +02:00
Robin Gareus dbc3008163
Add Lua Bindings for const shared_ptr lists (295dbd8e1e) 2023-04-12 20:47:35 +02:00
Paul Davis b35518e212 switch from boost::{shared,weak}_ptr to std::{shared,weak}_ptr
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
2023-03-24 14:19:15 -06:00
Paul Davis 39ed528e25 std-ize: convert all boost shared/weak ptr includes to <memory>
Also fix stdint.h -> cstdint and alphabetically order std includes
2023-03-24 14:19:15 -06:00
Robin Gareus 9914732004
Potential fix for C++20 std::set::* ambiguity
(until C++20) bool empty() const noexcept;
(since C++20) [[nodiscard]] bool empty() const noexcept;
2022-10-19 16:06:47 +02:00
Robin Gareus 46b14498f8
Prepare Lua bindings for std::set::insert 2022-10-17 23:09:04 +02:00
Robin Gareus e98fe4729e
LuaBridge - add API to try convert a value
This in in preparation to overload operators
2022-09-26 21:39:21 +02:00
Raphael Isemann 3dfcbf17b2
Fix memory leak in ctorNilPtrPlacementProxy 2022-04-08 18:21:55 +02:00
Paul Davis 7bf89ce109 Constification: make Stateful::get_state() const, with all other required const-ness added (libs) 2022-04-06 21:56:59 -06:00
Robin Gareus d51a1ccd99
Add API to modify Lua Metatable and set Metamethods
This allows to map C++ operators to be used as Lua
arithmetic and relational operations.
2022-01-24 06:23:16 +01:00
Mads Kiilerich 8bb91099c5 wscript: drop configure statements already present in the top level wscript
Avoid repeated pointless configure messages like:
Checking for 'g++' (C++ compiler!)                   : /usr/lib64/ccache/g++
Checking for 'gcc' (C compiler)                      : /usr/lib64/ccache/gcc
2022-01-22 22:19:03 +01:00
Robin Gareus 1c0593201c
Allow Lua bindings up to 12 method arguments 2021-12-03 13:32:49 +01:00
Robin Gareus 115c79874a
Fix Lua bindings for C++17/C++20 -- #8683
std::list/vector/map declarations change, requiring
explicit cast to avoid FuncTraits ambiguities.
2021-05-02 16:36:30 +02:00
John Emmas b625461132 Guard some code which isn't currently buildable with VS2019
For some unknown reason, VC++2019 won't let us take the address of std::list::unique() - although other std::list members seem okay. I've spent weeks tracking this down but there's no fix available AFAICT.

I've flagged it up to the MSVC development team - just don't hold your breath !!
2021-03-06 11:12:02 +00:00
Robin Gareus 038307fef6
Allow Lua bindings up to 11 args 2021-01-08 22:50:37 +01:00
Robin Gareus 7c6eadd84a
Fix some doxygen warnings 2020-03-02 17:58:03 +01:00
Robin Gareus 34c4602e61
Lua Array, assert indices > 0 2020-02-06 17:30:21 +01:00
Robin Gareus fbacb13d2d
Extend Lua binding for static methods
This add support for Lua bindings for static member
functions in weak/share ptr class bindings.
2020-02-06 17:30:21 +01:00
Robin Gareus bca825e515
NO-OP: whitespace 2020-01-14 00:52:24 +01:00
Robin Gareus 5e1a73a28c
Add Lua typecast from C++ vector to C-Array
This is useful for MIDI bytes amongst other things
2019-12-01 21:32:10 +01:00
Robin Gareus 78cf0e5235
Customize Lua GC, add object-memory-lock API.
Add custom API to prevent Lua Objects from being garbage collected.
This is intended to for Ardour LuaBridge bindings (~1MB Objects:
tables, functions and userdata).
The bindings are persistent and the gc can skip them in mark & sweep
phases. This is a significant performance improvement for garbage
collection.

Note. The next version of Lua (5.4) will come with a generational-gc
rather than an incremental, so extending the API at this point in time
is acceptable.
2019-10-29 05:45:43 +01:00
Robin Gareus 130211a4bd
Update Lua to upstream 5.3.5 2019-10-29 05:36:24 +01:00
Robin Gareus 0301c47f6b
Update core library GPL boilerplate and (C) from git log 2019-08-03 15:53:17 +02:00
Robin Gareus bed2eb2e33
Fix std::list<hared_ptr<>> front/back methods
Shared pointer reference accessors can't be const
2019-05-17 12:09:07 +02:00
Robin Gareus 3da07e6736
Special case Lua copy-construction of trackable instances
This fixes an crashing issue with ArdourUI.SelectionList a bug
introduced in 6dc3bdf252 and 35dcd46d7d.

Since removal of the special cases in 35dcd46d7d, when using
a C-pointer in a std::list<>,
  std::list<class*>::push_back(TypeListValue)
TypeListValues<>'s Head was expanded to  "class*& const"
implied by void ::push_back(const T& value);

This resulted in lifetime issues with a classes that derive
from sigc::trackable (e.g. Ardour's Selection).
The reference leaves scope and isn't duplicated when it is pushed back
to the std::list<>.

The script scripts/select_every_2nd_region.lua crashed because entries
in the SelectionList were no longer valid.

Previously (before 6dc3bdf252) TypeListValues explicitly
copy-constructed the value to work around the lifetime issue.
This new solution bypasses the issue by directly using the c-pointer
without dereferencing it.
2019-04-12 05:45:27 +02:00
Paul Davis 8ed33f1bc7 remove use of hardcoded -fPIC compiler flag, and use compiler flag dict instead 2018-10-14 22:06:11 -04:00
John Emmas 9506a294c7 Adapt our remaining MSVC projects for 'boost::atomic' (in case it later gets extended to the other libs)
Stage 1 of 3 (more to follow)
2018-09-30 08:56:12 +01:00
John Emmas 79f01bc889 Initial changes needed for building Mixbus (with MSVC) as version 5
(Mixbus itself will probably need extra changes)
2018-09-10 07:14:59 +01:00
Robin Gareus f2ca0c144b Customize Lua GC, add object-memory-lock API.
Add custom API to prevent Lua Objects from being garbage collected.
This is intended to for Ardour LuaBridge bindings (~1MB Objects:
tables, functions and userdata).
The bindings are persistent and the gc can skip them in mark & sweep
phases. This is a significant performance improvement for garbage
collection.

Note. The next version of Lua (5.4) will come with a generational-gc
rather than an incremental, so extending the API at this point in time
is acceptable.
2018-03-19 02:23:09 +01:00
Robin Gareus 89f0604d89 Allow loadfile in non-rt scripts 2018-03-06 21:47:30 +01:00
John Emmas b9c9777b9a When building with MSVC, allow for the fact that Mixbus and Ardour can be using different versions of the SESSION_FILE format 2018-02-15 09:03:32 +00:00
John Emmas 6f019faaa0 Accommodate the change from libtimecode to libtemporal 2018-02-14 10:02:11 +00:00
Robin Gareus 77d16999b5 Tweak Lua GC 2017-11-29 12:06:42 +01:00
Robin Gareus 44cf448839 update to lua-5.3.4 2017-11-29 12:06:42 +01:00
Robin Gareus e951e68780 Add luaRef is Boolean 2017-08-18 20:42:55 +02:00
Robin Gareus 0191a9c4c2 Centralize Lua sandboxing 2017-08-10 02:25:49 +02:00
Robin Gareus ea8c6e9fc8 Fix hiding Lua __metatable -- prevent setmetatable() override 2017-03-30 05:06:34 +02:00
Robin Gareus 412b6a4cb9 Lua: make external (static) functions available for const objects.
This fixes iterators on const std::lists<>& and const std::map<>&
2017-03-30 04:15:28 +02:00
Robin Gareus 4a180e68ba Special case const std::string& Lua binding.
since 6dc3bdf, a const string reference would leave scope with Lua code
     fn("text")
calling a C++
     fn (const std::string&)
before the C++ function is called.
2017-03-22 16:59:02 +01:00
Robin Gareus 35dcd46d7d remove cruft (following 6dc3bdf) 2017-03-22 16:55:19 +01:00