Commit Graph

83 Commits

Author SHA1 Message Date
John MacFarlane
387e759a8e Bump to 0.30.3. 2023-01-23 10:40:54 -08:00
Nick Wellnhofer
9c8e834136 Add -Wstrict-prototypes and fix offending functions 2022-01-24 09:19:18 -08:00
John MacFarlane
2f03f1db5c Bump to 0.30.2, update changelog. 2021-09-24 08:49:40 -07:00
Saleem Abdulrasool
077736eeef Update CMakeLists.txt
Bump the minimum required CMake to 3.7.  CMake 3.1 is required for the `CMAKE_C_STANDARD` and `CMAKE_C_STANDARD_REQUIRED` options to take effect.  Relying on CMake to control the compiler this way allows us to avoid having to rebuild the logic for detecting the appropriate flags and ensuring that the compiler is able to support the necessary language version.
2021-08-21 17:30:58 -07:00
John MacFarlane
4e5068c1d9 Bump to 0.30.1, update cmark(3) man page. 2021-07-16 18:29:03 -07:00
Saleem Abdulrasool
023d887d9f build: allow building with CMake[<3.3]
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
2021-07-08 22:04:56 -07:00
John MacFarlane
8800e66010 Update version to 0.30.0. 2021-06-20 13:06:41 -07:00
Nick Wellnhofer
990aabe294 Reintroduce version check for MSVC /TP flag
The flag is only required for old MSVC versions.
2020-01-15 07:04:27 -08:00
John MacFarlane
845bce4018 Move C_VISIBILITY_PRESET back to src/CMakeLists.txt.
This reverts a change by @compnerd in commit
b6ffaca93e.
We don't want this for api_tests, as it triggers this warning:

```
CMake Warning (dev) at api_test/CMakeLists.txt:1 (add_executable):
  Policy CMP0063 is not set: Honor visibility properties for all target
  types.  Run "cmake --help-policy CMP0063" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  Target "api_test" of type "EXECUTABLE" has the following visibility
  properties set for C:

    C_VISIBILITY_PRESET

  For compatibility CMake is not honoring them for this target.
This warning is for project developers.  Use -Wno-dev to suppress it.
```
2020-01-05 12:44:15 -08:00
Saleem Abdulrasool
57a8094934 build: chmod -x CMakeLists.txt (NFC)
Remove the unnecessary execute permission on CMakeLists.txt.
2020-01-02 22:58:05 -07:00
Saleem Abdulrasool
3cad10545e build: use CMAKE_INCLUDE_CURRENT_DIRECTORY
This uses the CMake mechanism for including the current source and
binary directories.  This avoids the custom handling for this.
2020-01-02 22:58:05 -07:00
Saleem Abdulrasool
828eeaf896 build: improve man page installation
man pages are extremely useful, but are not generally available on
Windows.  This changes the install condition to check for the Windows
cross-compile rather than the toolchain in use.  It is possible to build
for Windows using clang in the GNU driver.
2020-01-02 22:58:05 -07:00
Saleem Abdulrasool
b7188e8c1b build: only include GNUInstallDirs once
Avoid including the utility once, which should avoid some unnecessary
CMake checks, and reduces duplication.
2020-01-02 22:58:05 -07:00
Saleem Abdulrasool
78168bfef1 build: replace add_compile_definitions (#321)
Replace `add_compile_definitions` with `add_compile_options` since the
former was introduced in 3.12.
2019-12-26 13:41:10 -08:00
Saleem Abdulrasool
b6ffaca93e build: cleanup CMake (#319)
* build: inline a variable

* build: use `LINKER_LANGUAGE` property for C++ runtime

Rather than explicitly name the C++ runtime, use the `LINKER_LANGUAGE`
property to use the driver to spell the C++ runtime appropriately.

* build: use CMake to control C standard

Rather than use compiler specific flags to control the language
standard, indicate to CMake the desired standard.

* build: use the correct variable

These flags are being applied to the *C* compiler, check the C compiler,
not the C++ compiler.

* build: loosen the compiler check

This loosens the compiler identifier check to enable matching AppleClang
which is the identifier for the Xcode compiler.

* build: hoist shared flags to top-level CMakeLists

This hoists the common shared flags handling to the top-level CMakeLists
from sub-layers.  This prevents the duplication of the handling.

* build: remove duplicated flags

This is unnecessary, `/TP` is forced on all MSVC builds, no need to
duplicate the flag for older versions.

* build: loosen C compiler identifier check

Loosen the check to a match rather than equality check, this allows it
to match AppleClang which is the identifier for the Apple vended clang
compiler part of Xcode.

* build: use `add_compile_options`

Use `add_compile_options` rather than modify `CMAKE_C_FLAGS`.  The
latter is meant to be only modified by the user, not the package
developer.

* build: hoist sanitizer flags to global state

This moves the CMAKE_C_FLAGS handling to the top-level and uses
`add_compile_options` rather than modifying the user controlled flags.

* build: hoist `-fvisibilty` flags to top-level

These are global settings, hoist them to the top level.

* build: hoist the debug flag handling

Use a generator expression and hoist the flag handling for the debug
build.

* build: hoist the profile flag handling

This is a global flag, hoist it to the top level and use
`add_compile_options` rather than modify the user controlled flags.

* build: remove incorrect variable handling

This seemed to be attempting to set the linker not the linker flags for
the profile configuration.  This variable is not used, do not set it.

* build: remove unused CMake includes
2019-12-22 10:21:35 -08:00
Eric Pruitt
f4895a6c62 Remove "-rdynamic" flag for static builds (#300)
cmake adds `-rdynamic` on linux, even for static builds.
This commit removes it for linux builds by resetting
`CMAKE_SHARED_LIBRARY_LINK_C_FLAGS`.
2019-05-29 12:28:07 -04:00
John MacFarlane
c64f1abf99 Bump version to 0.29.0. 2019-04-06 23:25:11 -07:00
Jonathan Müller
1104369647 Bump CMake to version 3 2019-03-18 12:13:52 +01:00
Nick Wellnhofer
772c4cbde5 Also run API tests with CMARK_SHARED=OFF 2017-11-18 16:16:01 +01:00
John MacFarlane
a2e06fa1ca BUmp to 0.28.3 2017-10-21 09:03:31 -07:00
John MacFarlane
e97d8f3cd4 Bump to 0.28.2, update changelog. 2017-10-12 08:00:06 -07:00
John MacFarlane
749e5f1279 Bump to 0.28.1, update changelog. 2017-10-10 21:13:55 -07:00
John MacFarlane
55d75efa93 Bump version to 0.28.0. 2017-08-01 12:07:52 -07:00
Phil Turnbull
c1dea4ee50 Add Makefile target and harness to fuzz with libFuzzer
This can be run locally with `make libFuzzer` but the harness will be
integrated into oss-fuzz for large-scale fuzzing.
2017-06-27 15:37:04 -04:00
Azamat H. Hackimov
c9c18fff2f Make shared and static libraries optional
Now you can enable/disable compilation and installation targets for
shared and static libraries via -DCMARK_SHARED=ON/OFF and
-DCMARK_STATIC=ON/OFF
2017-01-06 17:17:10 +05:00
John MacFarlane
4d2f310fe6 Bump version to 0.27.1, update changelog. 2016-11-19 09:44:32 +01:00
John MacFarlane
7825060249 Bump to 0.27.0. 2016-11-18 21:15:44 +01:00
John MacFarlane
48b811839a Bump to 0.26.1. 2016-07-16 09:21:43 -07:00
John MacFarlane
1dbcf46c6c Bump version to 0.26.0 2016-07-15 08:32:59 -07:00
Jonathan Müller
bf8bd830fc Change export install location 2016-06-27 21:59:39 +02:00
Jonathan Müller
cea0af4aad Fix cmake warning about CMP0048 2016-06-27 20:36:00 +02:00
Jonathan Müller
9fe857d827 Export the targets on installation
This allows using them in other cmake projects.
2016-06-27 19:54:25 +02:00
John MacFarlane
284e544f1b Version bump to 0.25.2. 2016-03-26 13:19:54 -07:00
John MacFarlane
836e244dd8 Updated version to 0.25.0. 2016-03-24 22:51:09 -07:00
tinysun212
ce9075fa0d Moved the cmake minimum version to top line
In the file CMakeLists.txt, the required version should be placed to top line. The information could not used at CMake/Modules/CYGWIN.cmake under Cygwin.
2016-03-10 08:14:01 +09:00
John MacFarlane
ae806c6176 Bump to 0.24.1, updated changelog. 2016-01-17 21:53:29 -08:00
John MacFarlane
a8ed144adf Bump version to 0.24.0 2016-01-12 22:01:45 -08:00
John MacFarlane
0aaf77ea8d Bump version to 0.23. 2015-12-28 22:29:39 -08:00
John MacFarlane
2d3d955942 Version bump to 0.22.0. 2015-08-23 21:53:09 -07:00
Kevin Wojniak
0209706acc Add option to disable tests 2015-08-11 10:30:39 -07:00
John MacFarlane
643b4f5fe0 Bump version to 0.21.0. 2015-07-14 15:33:28 -07:00
John MacFarlane
7d3fc1e3d3 Updated version to 0.20.0. 2015-06-06 18:54:37 -07:00
John MacFarlane
b4599a4869 Added Ubsan build target, to check for undefined behavior. 2015-05-29 10:15:29 -07:00
John MacFarlane
9cad14e567 Bump version to 0.19.0. 2015-04-27 23:11:13 -07:00
John MacFarlane
0e5a0584ce Bump version to 0.18.3. 2015-04-01 09:26:04 -07:00
John MacFarlane
d8528f2d5c Updated version to 0.18.2 2015-03-30 13:08:30 -07:00
John MacFarlane
b15b588af1 Version to 0.18.1. 2015-03-09 21:43:31 -07:00
John MacFarlane
417241800a Updated version to 0.18. 2015-03-03 22:33:35 -08:00
John MacFarlane
0fdb06f275 Added 'Asan' build type.
`make asan` will link against ASan; the resulting
executable will do checks for memory access issues.

Thanks @JordanMilne for the suggestion.
2015-02-19 10:34:34 -08:00
John MacFarlane
82d7fd56a6 Added Profile build type, 'make prof' target. 2015-01-28 14:26:06 -08:00