fixed flag error and made option nounistd in lexer depend on compiler used

This commit is contained in:
Sven Vogel 2024-04-24 22:47:59 +02:00
parent 8cd1f2fb0d
commit df927cf7d6
2 changed files with 6 additions and 4 deletions

View File

@ -36,6 +36,11 @@ add_custom_command(OUTPUT ${LEX_GENERATED_SOURCE_FILE}
COMMENT "generate C source file for lexer" COMMENT "generate C source file for lexer"
VERBATIM) VERBATIM)
# remove dependency when compiling with MSVC on windows
if (MSVC)
add_compile_definitions(YY_NO_UNISTD_H)
endif()
# ------------------------------------------------ # # ------------------------------------------------ #
# Yacc # # Yacc #
# ------------------------------------------------ # # ------------------------------------------------ #
@ -140,7 +145,7 @@ set_target_properties(check
if (MSVC) if (MSVC)
set(CHECK_FLAGS /DEBUG /WX) set(CHECK_FLAGS /DEBUG /WX)
else() else()
set(DEBUG_FLAGS -g /Werror) set(DEBUG_FLAGS -g -Werror)
endif() endif()
# compiler flags targeting a GCC debug environment # compiler flags targeting a GCC debug environment

View File

@ -12,9 +12,6 @@
%option nounput %option nounput
%option noinput %option noinput
/* prevent depency of unistd.h */
%option nounistd
%% %%
"\n" yyLineNumber++; "\n" yyLineNumber++;