summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt3
-rw-r--r--Makefile9
-rwxr-xr-xscripts/travis-build.sh5
-rwxr-xr-xscripts/travis-test.sh4
4 files changed, 19 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a97adf5f..4a06e856 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,9 +51,10 @@ include_directories(src ${SEXPR_WASM_BINARY_DIR})
add_definitions(-Wall -Werror -g)
+option(RUN_FLEX_BISON "run flex and bison" ON)
find_package(FLEX)
find_package(BISON)
-if (FLEX_FOUND AND BISON_FOUND)
+if (RUN_FLEX_BISON AND FLEX_FOUND AND BISON_FOUND)
set(BISON_PARSER_C ${SEXPR_WASM_BINARY_DIR}/wasm-bison-parser.c)
set(BISON_PARSER_H )
BISON_TARGET(WASM_BISON_PARSER
diff --git a/Makefile b/Makefile
index 8cff7fa0..6d0d0698 100644
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,7 @@ BUILD_TYPES := DEBUG RELEASE
SANITIZERS := NO ASAN MSAN LSAN
GCC_DEBUG_DIR := out/gcc/Debug
+GCC_DEBUG_NO_FLEX_BISON_DIR := out/gcc/Debug-no-flex-bison
GCC_RELEASE_DIR := out/gcc/Release
GCC_I686_DEBUG_DIR := out/gcc-i686/Debug
GCC_I686_RELEASE_DIR := out/gcc-i686/Release
@@ -37,6 +38,7 @@ GCC_I686_FLAG := -DCMAKE_C_COMPILER=gcc -DCMAKE_C_FLAGS=-m32
CLANG_FLAG := -DCMAKE_C_COMPILER=clang
GCC_DEBUG_PREFIX := gcc-debug
+GCC_DEBUG_NO_FLEX_BISON_PREFIX := gcc-debug-no-flex-bison
GCC_RELEASE_PREFIX := gcc-release
GCC_I686_DEBUG_PREFIX := gcc-i686-debug
GCC_I686_RELEASE_PREFIX := gcc-i686-release
@@ -63,7 +65,7 @@ $$($(1)_$(2)_DIR)/:
mkdir -p $$($(1)_$(2)_DIR)
$$($(1)_$(2)_DIR)/Makefile: | $$($(1)_$(2)_DIR)/
- cd $$($(1)_$(2)_DIR) && cmake ../../.. $$($(1)_FLAG) $$($(2)_FLAG)
+ cd $$($(1)_$(2)_DIR) && cmake ../../.. $$($(1)_FLAG) $$($(2)_FLAG) $(3)
endef
define EXE
@@ -114,3 +116,8 @@ $(foreach SANITIZER,$(SANITIZERS), \
$(foreach COMPILER,$(COMPILERS), \
$(foreach BUILD_TYPE,$(BUILD_TYPES), \
$(eval $(call TEST,$(COMPILER),$(BUILD_TYPE),$(SANITIZER))))))
+
+# One-off build target for running w/out flex + bison
+$(eval $(call CMAKE,GCC,DEBUG_NO_FLEX_BISON,-DRUN_FLEX_BISON=OFF))
+$(eval $(call EXE,GCC,DEBUG_NO_FLEX_BISON,sexpr-wasm,NO))
+$(eval $(call TEST,GCC,DEBUG_NO_FLEX_BISON,NO))
diff --git a/scripts/travis-build.sh b/scripts/travis-build.sh
index 30f9da5b..eb6ee9c7 100755
--- a/scripts/travis-build.sh
+++ b/scripts/travis-build.sh
@@ -21,6 +21,11 @@ set -o errexit
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
source ${SCRIPT_DIR}/travis-common.sh
+# Build without flex/bison to test prebuilt C sources
+if [ ${CC} = "gcc" ]; then
+ make gcc-debug-no-flex-bison-sexpr-wasm
+fi
+
for COMPILER in ${COMPILERS}; do
for BUILD_TYPE in ${BUILD_TYPES}; do
make ${COMPILER}-${BUILD_TYPE}-sexpr-wasm
diff --git a/scripts/travis-test.sh b/scripts/travis-test.sh
index 4dc3279b..b684333f 100755
--- a/scripts/travis-test.sh
+++ b/scripts/travis-test.sh
@@ -34,6 +34,10 @@ run_tests() {
(cd ${ROOT_DIR} && log_and_run test/run-tests.py -e ${EXE} ${ARG_FLAG-} --timeout=10)
}
+if [ ${CC} = "gcc" ]; then
+ run_tests out/gcc/Debug-no-flex-bison/sexpr-wasm
+fi
+
for COMPILER in ${COMPILERS}; do
for BUILD_TYPE in ${BUILD_TYPES_UPPER}; do
EXE=out/${COMPILER}/${BUILD_TYPE}/sexpr-wasm