Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I suspect since the bindings were moved out of the
src/
directory, theCMAKE_SWIG_FLAGS
haven't been propagating to theswig
command line that generates the wrapper script. This means that the#ifdef
s in theopenshot.i
files are all interpreted wrong.This PR adds generator expression logic to copy every public compile definition from the
openshot
library target over to theSWIG_FLAGS
of theopenshot.i
file, which should ensure that the bindings are generated correctly.In my version of CMake, all compile definitions are stored in the target property without the leading
-D
, even if it was originally set. So, the generator expression I added will prepend-D
to each of the values. I'll have to check whether that holds for older CMake versions as well, otherwise we might end up with-D-DUSE_RESVG=1
or the like, which would be a problem. The CI runs should be a fair test of that, though. (And just in case, I took the-D
s out of the definitions we set, at least.)Edit: That wasn't the issue, but older CMakes did have a problem with the generator expressions. Added a workaround using
get_property()
, tested back to CMake 3.5.Also added a fix to
FindResvg.cmake
, for compatibility with older CMake versions.