From 1a683c1864eaac3255f464dd63eff3619bd9ced6 Mon Sep 17 00:00:00 2001 From: Wataru Ashihara Date: Sat, 23 May 2020 18:22:27 +0900 Subject: Improve flex/bison debuggability with gdb This changes "#line" in generated C++ source: #line 26 "doctokenizer.l" to: #line 26 "/absolute/path/to/doctokenizer.l" so that gdb can recognize the original .l .y source locations and step into them. --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e880722..3230a4b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -129,11 +129,11 @@ foreach(lex_file ${LEX_FILES}) ) set_source_files_properties(${GENERATED_SRC}/${lex_file}.l.h PROPERTIES GENERATED 1) - FLEX_TARGET(${lex_file} ${lex_file}.l ${GENERATED_SRC}/${lex_file}.cpp COMPILE_FLAGS "${LEX_FLAGS}") + FLEX_TARGET(${lex_file} ${CMAKE_CURRENT_LIST_DIR}/${lex_file}.l ${GENERATED_SRC}/${lex_file}.cpp COMPILE_FLAGS "${LEX_FLAGS}") endforeach() -BISON_TARGET(constexp constexp.y ${GENERATED_SRC}/ce_parse.cpp COMPILE_FLAGS "${YACC_FLAGS}") +BISON_TARGET(constexp ${CMAKE_CURRENT_LIST_DIR}/constexp.y ${GENERATED_SRC}/ce_parse.cpp COMPILE_FLAGS "${YACC_FLAGS}") add_library(doxycfg STATIC ${GENERATED_SRC}/lang_cfg.h -- cgit v0.12