From 0e38a3706039607fb276228648f726ca9e15f6f0 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Wed, 31 Dec 2014 16:24:14 +0100 Subject: Feature test for va_copy MSVC doesn't support va_copy. --- src/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/CMakeLists.txt') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 87651bc..bb0c7c1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -117,6 +117,7 @@ install(FILES cmark.h ${CMAKE_CURRENT_BINARY_DIR}/cmark_export.h # Feature tests include(CheckIncludeFile) include(CheckCSourceCompiles) +include(CheckSymbolExists) CHECK_INCLUDE_FILE(stdbool.h HAVE_STDBOOL_H) CHECK_C_SOURCE_COMPILES( "int main() { __builtin_expect(0,0); return 0; }" @@ -125,6 +126,7 @@ CHECK_C_SOURCE_COMPILES(" int f(void) __attribute__ (()); int main() { return 0; } " HAVE___ATTRIBUTE__) +CHECK_SYMBOL_EXISTS(va_copy stdarg.h HAVE_VA_COPY) CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in -- cgit v1.2.3 From e8a994cddc17eabaa415c73d970205aa489a756c Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Wed, 31 Dec 2014 17:01:13 +0100 Subject: Recreate scanners.c only on demand --- src/CMakeLists.txt | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'src/CMakeLists.txt') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bb0c7c1..b4a0fe8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -47,24 +47,6 @@ set(PROGRAM_SOURCES include_directories(. ${CMAKE_CURRENT_BINARY_DIR}) -set(RE2C re2c) -if (MSVC) - file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} DOS_CURRENT_SOURCE_DIR) - add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/scanners.c - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scanners.re - COMMAND ${RE2C} --case-insensitive -b -i - --no-generation-date - -o ${DOS_CURRENT_SOURCE_DIR}\\scanners.c - ${DOS_CURRENT_SOURCE_DIR}\\scanners.re ) -else(MSVC) - add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/scanners.c - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scanners.re - COMMAND ${RE2C} --case-insensitive -b -i - --no-generation-date - -o ${CMAKE_CURRENT_SOURCE_DIR}/scanners.c - ${CMAKE_CURRENT_SOURCE_DIR}/scanners.re ) -endif(MSVC) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libcmark.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libcmark.pc @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcmark.pc -- cgit v1.2.3