Skip to content
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

build: allow building with CMake[<3.3] #385

Merged
merged 1 commit into from
Jul 9, 2021

Conversation

compnerd
Copy link
Contributor

@compnerd compnerd commented Jul 6, 2021

The COMPILE_LANGUAGE generator expression was introduced in CMake 3.3.
Debian Jessie has an older CMake version bundled, which prevents
building on that platform without manually building CMake. This
uses a more error-prone mechanism of requiring the commonmark developer
to explicitly invoke cmark_add_compile_options on the target to ensure
that the flags are propagated for the targets without using the
generator expression. Adding the options unconditionally prevents using
CMark in a build with a non-C programming language.

Fixes: #384

The `COMPILE_LANGUAGE` generator expression was introduced in CMake 3.3.
Debian Jessie has an older CMake version bundled, which prevents
building on that platform without manually building CMake.  This
uses a more error-prone mechanism of requiring the commonmark developer
to explicitly invoke `cmark_add_compile_options` on the target to ensure
that the flags are propagated for the targets without using the
generator expression.  Adding the options unconditionally prevents using
CMark in a build with a non-C programming language.

Fixes: commonmark#384
@jgm
Copy link
Member

jgm commented Jul 6, 2021

requiring the commonmark developer to explicitly invoke cmark_add_compile_options on the target to ensure that the flags are propagated for the targets without using the generator expression

Not sure what you mean by this...do you mean that the standard build instructions won't work any more (something else needs to be done?)

@compnerd
Copy link
Contributor Author

compnerd commented Jul 7, 2021

Not sure what you mean by this...do you mean that the standard build instructions won't work any more (something else needs to be done?)

Correct. You will find that every instance of add_executable and add_library (except the aliases) are now followed by a call to the new function. Because it is a custom function, this is something that isn't in the official CMake documentation and needs to be enforced by the project. This is something that anyone adding new libraries or binaries to this project would need to be aware of.

@jgm
Copy link
Member

jgm commented Jul 7, 2021

I don't think I made myself clear enough. What I'm asking about is whether the procedure for a user to build and install this library using cmake would be any different as a result of this change?

@compnerd
Copy link
Contributor Author

compnerd commented Jul 7, 2021

Oh, from the user's perspective everything remains the same as before.

@jgm
Copy link
Member

jgm commented Jul 9, 2021

Thanks.

@jgm jgm merged commit 023d887 into commonmark:master Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build fails on Debian Jessie
2 participants