Compare commits

...

11 Commits

Author SHA1 Message Date
Michael Fabian 'Xaymar' Dirks 54cd3eef5b cmake: Actually add sources to the Core component 2023-09-03 15:32:46 +02:00
Michael Fabian 'Xaymar' Dirks d8a673a578 cmake: Always provide at least one file to a target
While this would normally work no questions asked in something like 'make', 'nmake' or similar, it is an impossible task in CMake without an empty file. So we'll just provide it with an empty file.
2023-09-03 15:32:46 +02:00
Michael Fabian 'Xaymar' Dirks efb6e9f0cb cmake: Only enable Qt on components, not on the module
The module only holds the resources file, so Qt is not needed here.
2023-09-03 15:32:46 +02:00
Michael Fabian 'Xaymar' Dirks 0ce977b9dd cmake: Uncomment still working code 2023-09-03 15:32:46 +02:00
Michael Fabian 'Xaymar' Dirks 98403126ad cmake: Fix missing public info, and remove PROJECT_NAME usage
Using PROJECT_NAME makes it incompatible with add_subdirectory, and it's really not necessary anyway. There are no plans to rename the project again.

Also needed to expose some information to be public, so that components could actually use it. Seems to be working as intended finally.
2023-09-03 15:32:46 +02:00
Michael Fabian 'Xaymar' Dirks 8fb37b8d21 cmake: Fix up missing sub-components due to add_subdirectory
add_subdirectory creates a new "stack" of variables, so PARENT_SCOPE points nowhere. Well it points to the outside of the function, which is not outside of the subproject.
2023-09-03 15:32:46 +02:00
Michael Fabian 'Xaymar' Dirks d82d3901e4 cmake: Remove remnants of AOM AV1 2023-09-03 15:32:46 +02:00
Michael Fabian 'Xaymar' Dirks f26565cf1e cmake: Remove clang integration, as it breaks on the new system 2023-09-03 15:32:46 +02:00
Michael Fabian 'Xaymar' Dirks 9021274297 cmake: Fix up missing linked objects in component system
We should always link the whole object, even if nothing is needed by the module itself.
2023-09-03 15:32:46 +02:00
Michael Fabian 'Xaymar' Dirks 25ba51df12 code: Throw an error on nullptr for util::library::load 2023-09-03 15:32:46 +02:00
Michael Fabian 'Xaymar' Dirks 50c85608c3 cmake: Initial work towards component-ification
The old fake component system is starting to be very annoying to work with, as it doesn't properly split things apart. The new system should aid with this significantly, and make errors easier to spot.
2023-09-03 15:32:46 +02:00
3 changed files with 589 additions and 456 deletions

File diff suppressed because it is too large Load Diff

View File

@ -112,6 +112,8 @@ MODULE_EXPORT bool obs_module_load(void)
}
}
MODULE_EXPORT void obs_module_post_load(void) {}
MODULE_EXPORT void obs_module_unload(void)
{
try {

View File

@ -102,6 +102,10 @@ std::shared_ptr<::streamfx::util::library> streamfx::util::library::load(std::st
std::shared_ptr<::streamfx::util::library> streamfx::util::library::load(obs_module_t* instance)
{
if (!instance) {
throw std::runtime_error("Can't load nullptr as a library.");
}
// Get an absolute path to the module.
auto path = std::filesystem::absolute(std::filesystem::u8path(obs_get_module_binary_path(instance)));