summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2014-12-31 17:01:13 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2014-12-31 17:14:01 +0100
commite8a994cddc17eabaa415c73d970205aa489a756c (patch)
treeeb3e9f177bd4f9bbcc15deabc9c764e421c59972
parentfc9c8eed3d1b7f7608b8451c53b214e502f1b8f1 (diff)
Recreate scanners.c only on demand
-rw-r--r--.travis.yml2
-rw-r--r--Makefile5
-rw-r--r--src/CMakeLists.txt18
3 files changed, 6 insertions, 19 deletions
diff --git a/.travis.yml b/.travis.yml
index 67ad397..b96f79b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,7 +6,7 @@ before_install:
# we need a more recent cmake than travis provides (at least 2.8.9):
- echo "yes" | sudo add-apt-repository ppa:kalakris/cmake
- sudo apt-get update -qq
- - sudo apt-get install -qq cmake python3 pandoc re2c valgrind
+ - sudo apt-get install -qq cmake python3 pandoc valgrind
script:
- make testtarball
- PROG=`ls cmark-*.*/build/src/cmark` make leakcheck
diff --git a/Makefile b/Makefile
index e0679e5..e00107a 100644
--- a/Makefile
+++ b/Makefile
@@ -85,6 +85,11 @@ $(SRCDIR)/html_unescape.h: $(SRCDIR)/html_unescape.gperf
$(SRCDIR)/case_fold_switch.inc: $(DATADIR)/CaseFolding-3.2.0.txt
perl mkcasefold.pl < $< > $@
+# We include scanners.c in the repository, so this shouldn't
+# normally need to be generated.
+$(SRCDIR)/scanners.c: $(SRCDIR)/scanners.re
+ re2c --case-insensitive -b -i --no-generation-date -o $@ $<
+
test: $(SPEC) $(BUILDDIR)
make -C $(BUILDDIR) test ARGS="-V"
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