Revert "remove empty config.h and cmark-gfm_config.h headers"

This reverts commit 6f648763b2.
This commit is contained in:
Kenta Kubo
2024-11-05 01:42:38 +09:00
parent ebf5f2b4bd
commit 1153b7f24e
23 changed files with 59 additions and 1 deletions

View File

@@ -76,6 +76,8 @@ endif()
add_compile_definitions($<$<CONFIG:Debug>:CMARK_DEBUG_NODES>)
# FIXME(compnerd) why do we not use `!defined(NDEBUG)`?
add_compile_definitions($<$<CONFIG:Debug>:DEBUG>)
# Use CMake's generated headers instead of the Swift package prebuilt ones
add_compile_definitions(CMARK_USE_CMAKE_HEADERS)
add_compile_options($<$<AND:$<CONFIG:PROFILE>,$<COMPILE_LANGUAGE:C>>:-pg>)

View File

@@ -38,6 +38,7 @@ let package = Package(
exclude: [
"scanners.re",
"libcmark-gfm.pc.in",
"config.h.in",
"CMakeLists.txt",
],
cSettings: cSettings

View File

@@ -4,6 +4,7 @@
#include <stdlib.h>
#include <string.h>
#include "cmark-gfm_config.h"
#include "cmark-gfm.h"
#include "node.h"
#include "cmark-gfm-extension_api.h"

View File

@@ -1,3 +1,6 @@
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
${CMAKE_CURRENT_BINARY_DIR}/config.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libcmark-gfm.pc.in
${CMAKE_CURRENT_BINARY_DIR}/libcmark-gfm.pc @ONLY)
@@ -68,6 +71,7 @@ install(FILES
include/chunk.h
include/cmark_ctype.h
include/cmark-gfm.h
include/cmark-gfm_config.h
include/cmark-gfm-extension_api.h
include/cmark-gfm_version.h
include/export.h

View File

@@ -13,6 +13,7 @@
#include "cmark_ctype.h"
#include "syntax_extension.h"
#include "cmark-gfm_config.h"
#include "parser.h"
#include "cmark-gfm.h"
#include "node.h"

View File

@@ -7,6 +7,7 @@
#include <stdlib.h>
#include <string.h>
#include "cmark-gfm_config.h"
#include "cmark_ctype.h"
#include "buffer.h"

View File

@@ -5,6 +5,7 @@
#include <stdlib.h>
#include <string.h>
#include "cmark-gfm_config.h"
#include "cmark-gfm.h"
#include "node.h"
#include "buffer.h"

12
src/config.h.in Normal file
View File

@@ -0,0 +1,12 @@
#ifndef CMARK_CONFIG_H
#define CMARK_CONFIG_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -5,6 +5,7 @@
#include <string.h>
#include "cmark_ctype.h"
#include "cmark-gfm_config.h"
#include "cmark-gfm.h"
#include "houdini.h"
#include "scanners.h"

View File

@@ -6,6 +6,7 @@
#include <string.h>
#include <limits.h>
#include <stdint.h>
#include "cmark-gfm_config.h"
#include "cmark-gfm.h"
#ifdef __cplusplus

View File

@@ -0,0 +1,21 @@
#ifndef CMARK_CONFIG_H
#define CMARK_CONFIG_H
#ifdef CMARK_USE_CMAKE_HEADERS
// if the CMake config header exists, use that instead of this Swift package prebuilt one
// we need to undefine the header guard, since config.h uses the same one
#undef CMARK_CONFIG_H
#include "config.h"
#else
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /* not CMARK_USE_CMAKE_HEADERS */
#endif /* not CMARK_CONFIG_H */

View File

@@ -2,7 +2,7 @@
#define CMARK_HOUDINI_H
#include <stdint.h>
#include "cmark-gfm_config.h"
#include "buffer.h"
#ifdef __cplusplus

View File

@@ -4,6 +4,7 @@
#include <stdbool.h>
#include <stdlib.h>
#include "cmark-gfm_config.h"
#include "references.h"
#ifdef __cplusplus

View File

@@ -1,5 +1,6 @@
module cmark_gfm {
header "cmark-gfm.h"
header "cmark-gfm_config.h"
header "cmark-gfm-extension_api.h"
header "buffer.h"
header "chunk.h"

View File

@@ -1,6 +1,8 @@
#ifndef CMARK_MUTEX_H
#define CMARK_MUTEX_H
#include "cmark-gfm_config.h"
#include <stdbool.h>
#ifndef CMARK_THREADING

View File

@@ -3,6 +3,7 @@
#include "cmark-gfm.h"
#include "cmark-gfm-extension_api.h"
#include "cmark-gfm_config.h"
#include <stdbool.h>

View File

@@ -4,6 +4,7 @@
#include <string.h>
#include "cmark_ctype.h"
#include "cmark-gfm_config.h"
#include "node.h"
#include "parser.h"
#include "references.h"

View File

@@ -2,6 +2,7 @@
#include <stdbool.h>
#include <stdlib.h>
#include "cmark-gfm_config.h"
#include "node.h"
#include "cmark-gfm.h"
#include "iterator.h"

View File

@@ -4,6 +4,7 @@
#include <stdlib.h>
#include <string.h>
#include "cmark-gfm_config.h"
#include "cmark-gfm.h"
#include "node.h"
#include "buffer.h"

View File

@@ -4,6 +4,7 @@
#include <stdlib.h>
#include <string.h>
#include "cmark-gfm_config.h"
#include "cmark-gfm.h"
#include "node.h"
#include "buffer.h"

View File

@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <string.h>
#include "cmark-gfm_config.h"
#include "mutex.h"
#include "node.h"
#include "syntax_extension.h"

View File

@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <string.h>
#include "cmark-gfm_config.h"
#include "cmark-gfm.h"
#include "mutex.h"
#include "syntax_extension.h"

View File

@@ -4,6 +4,7 @@
#include <stdlib.h>
#include <string.h>
#include "cmark-gfm_config.h"
#include "cmark-gfm.h"
#include "node.h"
#include "buffer.h"