-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMake rework, CIs added, and some ideas #13
base: master
Are you sure you want to change the base?
Conversation
Hi - Thanks, I'll check this out! We have unit tests internally, but I need to get them checked into the repo. We'll be adding a C-style API and examples for the compressor/transcoder which should hopefully make the encoder easier to use, as well as API documentation. Also, we'll be moving the encoder to a library, and removing OpenMP support. -Rich |
Hi, |
I'm also interested in seeing work done in the CMake on this, and this looks like a great start. A few things I noticed:
Version related stuff:
I'm happy to address these and put it in as a PR to @mattparks branch so it can show up here if folks are interested in some/all of these. I've already been playing around locally so it wouldn't be hard to wrap this stuff up. |
Thanks for the suggestions
I'd love to see your changes to my start, I'm by far not the best with CMake, this or was my start of improvements. |
Oh, interesting! Apologies then! I looked it up in their docs but didn't see it, must have missed it. It would still be nice to find a way to not hit this pain point though, I'll look further into it!
I'm fairly sure they have no need for C++17, so for now on this branch I'll assume 3.8.2 and C++11, and when they get back to us I can adjust backwards.
Right now I'm playing with putting the libs and exe in |
It's redundant in current releases according to Stephen Kelly: https://stackoverflow.com/a/27305021
Addressing issues from binomial/basis_universal PR
Some engines don't support OpenMP, and I believe clang on OSX doesn't support OpenMP "out of the box" yet. So the plan is to replace it by using a simple C++0x11 thread pool/job system, and lambdas. I've done this on another project before. It should be a simple switch over and it'll give basisu better thread utilization. I'll check out what I can merge from this PR into master. I'm not really a cmake person, so seeing alternative ways of using it is valuable. Thanks, |
For sure, and I'm happy to make a new PR if you have specific things in mind but don't want to muck around too much in CMake, I know it can be annoying. I have a version where it detects OpenMP support right now as well. The main idea is that if you have a CMake, ideally we don't need to also store Visual Studio project files. Plus we can get libraries for the compressor and the transcoder, and a separate executable for the tool. |
Given the movement of files in this PR, keeping it up to date with changes in master is going to be challenging long term. I've done a rebase on to the current master here but it wasn't trivial and I had to do with a number of merge conflicts. I'm doing this because I'd ultimately like to create a PR that makes basisu available as a vcpkg port, and without this cmake re-work such a port would be significantly harder. @mattparks if you'd like I can create a new PR with my rebase, or you can inspect it if it's helpful in performing your own rebase. |
One suggestion I would make is to remove the lodepng source code from Since we don't want to generate either a static or dynamic for lodepng, if finding an existing one on the build system fails, we could incorporate it as an object library, which basically gives you the same behavior as if he source were included directly in the encoder project, but doesn't eliminate the option of using an found copy of the library instead. Again, this goes back to my work on trying to make this a port for vcpkg, where lodepng already exists as a port and therefore making basisu depend on lodepng would be preferable to directly incorporating lodepng here. |
Added a pull request to vcpkg to add basisu here: microsoft/vcpkg#6995 Basis Universal doesn't seem to have a version number scheme, so I've tagged it as 0.0.1 in lieu of something better. Additionally I've made the changes regarding lodepng and I've disable the code that sets the iterator debug level to 1 instead of 2 in the code, since virtually every other package out there uses 2. |
Hi - There's a lot being talked about/changed here, and as I am currently working on the next milestone goals I have to juggle that with trying to follow this. I'm totally open to improving the cmake files and moving towards a vcpkg. "I've disable the code that sets the iterator debug level to 1 instead of 2 in the code, since virtually every other package out there uses 2." We set level 1 because level 2 enables full iterator debugging. Unfortunately level 2 is exceptionally slow, and it'll make debugging the library a very frustrating (if not nearly impossible) experience. |
If you have any feedback on another route to get there that might make you more comfortable merging, please let us know. It should be possible to do all this without re-organizing the files into folders, but that path would likely lead to a single extremely large cmake script that would be much harder to maintain over time. While this PR could be redone as a series of smaller changes, the file re-organization is inevitably going to still need to be the first step, otherwise it's going to be even harder to get the project into it's final state.
As a package author that's valuable, but once in the package system, the vast majority of debug builds will be because someone downstream is doing a debug build, rather than debugging iterators in this package. Additionally, since I will restore the level 1 iterator debugging in my fork but wrap it in a preprocessor macro so that it depends on the use of cmake arguments. |
This is an old PR, and we weren't able to take it because it changed the build too much. However - there are some good ideas in here, which we will merge next year. I'll leave this PR up as a reference. Thanks again! |
I don't expect this to be merged, but this PR allows basis universal to be used as a CMake library. I'll make changes to this PR as requested.
Changed:
BASISU_HEADER_FILES
can be changed accordinglyIdeas: