Since we're using OpenGL, everything has to be done in the same thread anyways. Besides that, the actual "multithreading" implementation was basically starting an empty thread that did absolutely nothing, then wait synchronously for it to complete and join it on the next frame.
Instead of using these expressions, adding "lib" in fron of static libs is now done via CMAKE_STATIC_LIBRARY_PREFIX when building static libs on Windows.
Requires a general rewrite of the Milkdrop preset code. Previous implementation was tightly integrated into the code parser, so reusing this code wasn't possible. Additional refactoring was done, finished converting custom wave/shape implementations to use the new expression parser code.
Won't change anything in regard to the previous defaults, but allows users to use CMake's default way of passing these dirs, as requested in GitHub issue #527
Only export API symbols, keep everything else hidden. C++ API will only expose the ProjectM and PCM classes, but no internals.
If devs want to have full access to projectM's internals, they need to adapt the build process to their own needs.
Target name is now just libprojectM::projectM for the main library instead of libprojectM::static or libprojectM::shared.
Now using CMake's default mechanism to select the resulting library type via the BUILD_SHARED_LIBS variable. Main use case will be working with the shared library, which is the default.
Playlist library now also builds as a shared library, including proper symbol exports.
Additionally, deleted the leftover TestRunner class and a few old and rather useless test cases.
Also added LLVM find_package call and as a link dependency if the build is configured for using (experimental) LLVM code.
Reorganized tests to link either one of the object libraries for unit testing.
Path scanning is using C++17's std::filesystem if available, but uses boost::filesystem as fallback. Using boost can be forced using the ENABLE_BOOST_FILESYSTEM CMake option.
The native presets did not build anymore due to refactorings, cause other build issues on Windows (e.g. require linking to psapi.lib) and would need a complete makeover anyway.
This fixes the following CMake error when configuring with just
-DENABLE_STATIC_LIB=OFF:
CMake Error at src/libprojectM/CMakeLists.txt:130 (add_library):
add_library cannot create ALIAS target "projectM::libprojectM" because
target "projectM_static" does not already exist.
In this case, static linking is disabled, thus the "projectM_static"
CMake target doesn't exist. Previously, ENABLE_SHARED_LINKING was always
false, and because of that, "projectM::libprojectM" was added as as an
alias to "projectM_static", which didn't exist.
Now, ENABLE_SHARED_LINKING is set to true only when ENABLE_SHARED_LIB is
enabled, otherwise it will be false.
Also export the target for linking the static libprojectM library in downstream projects. This is not required for the shared lib, and in this case, missing OpenMP compiler/linker support will not fail the build.
Multithreading will now also work on Windows while the STL variant is even less verbose, making the code easier to read. Thus enabled threading for all platforms, including emscripten.
- Got rid of the WORD_BITS usage in omptl_tools.h, which is a macro that is only defined on UNIX platforms, but not MSVC.
- Removed export(PACKAGE) call, as it's been disabled/deprecated since CMake 3.15 and puts a half-baked config into the registry. Better install and use CMAKE_PREFIX_PATH.
- Removed set_and_check commands in the package config file, added missing include for the target definition file.
- Added "lib" prefix to the static library file on Windows as it will otherwise have the exact same name (projectM.lib) as the shared library exports file.
- Enable shared library building on Windows by default as on all other platforms.
- On Windows, search for package GLEW as it's required.
Changes:
- Removed the unneeded and non-standard gl3ext.h include in SOIL2 that's not present in the official GLES3 specs.
- Auto-detect emscripten via CMAKE_SYSTEM_NAME instead of using an option.
- Disable all other feature detection code if emscripten is used.
- Remove old project files and convert the sample entry point app to use the new C-based API and SDL2 only.
- Updated emscripten build instructions in the README.md.
The find script changes will be proposed upstream for patching the built-in CMake module. Until that's merged, we use the local copy if GLES3 is requested.
Enabling GLES3 on desktop Linux should work out-of-the box now provided the required libs and headers are there. For example, Mesa's GLES implementation will work.