Skip to content

Commit

Permalink
build: minor tweaks for speeding up the configure phase
Browse files Browse the repository at this point in the history
Only the C language is used unless we are building the ASAN or UBSAN
build variants. Only check for the C language support, enabling C++
support in the case that the build type is one of those two.

Restructure the file layout to place the custom modules into the
`cmake/modules` directory that is the common layout for CMake based
projects.

While a generally unimportant optimization, it makes it much more clear
what is being checked and why and does reduce the configure time by ~10%
(.25s) on Windows.
  • Loading branch information
compnerd committed Jan 6, 2024
1 parent 820df08 commit 605a41f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ if(POLICY CMP0092)
cmake_policy(SET CMP0092 NEW)
endif()

project(cmark VERSION 0.30.3)
project(cmark
LANGUAGES C
VERSION 0.30.3)

include("FindAsan.cmake")
if(CMAKE_BUILD_TYPE MATCHES "asan|ubsan")
enable_language(CXX)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
include(FindAsan)
endif()
include(GNUInstallDirs)
include(CTest)

Expand Down
File renamed without changes.

0 comments on commit 605a41f

Please sign in to comment.