From c873fad0b4c2948551e53c082a3829243c4ccb9f Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 5 Mar 2016 19:53:51 +0100 Subject: [PATCH] Adding compilation options for flex/lex and bison/yacc The pull request #419 didn't work for the ninja build platform The pull request #442 did only work when cmake was called but not during compilation ("make") In this patch we set the LEX_FLAGS and YACC_FLAGS when specified on the command line with cmake to the specified value, in the other case these flags are for the Ninja build system they are omitted and for all other build systems they are set to $(LEX_FLAGS) and $(YACC_FLAGS) so they can be used during runtime as well. --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a020f416ce5..4c55859e01d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,6 +55,14 @@ if (WIN32) add_definitions(-DLIBICONV_STATIC -D_CRT_SECURE_NO_WARNINGS) endif() +if ("${CMAKE_GENERATOR}" MATCHES "Ninja") + set(LEX_FLAGS ) + set(YACC_FLAGS ) +else ("${CMAKE_GENERATOR}" MATCHES "Ninja") + set(LEX_FLAGS $(LEX_FLAGS)) + set(YACC_FLAGS $(YACC_FLAGS)) +endif ("${CMAKE_GENERATOR}" MATCHES "Ninja") + find_program(DOT NAMES dot) find_package(PythonInterp REQUIRED) find_package(FLEX REQUIRED)