diff options
author | João Valverde <j@v6e.pt> | 2023-05-25 20:38:57 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2023-05-25 21:45:22 +0000 |
commit | 0da67aee0256a8fa1afbade2f0293371a4c1c446 (patch) | |
tree | 0515512deff2376219681bfa7c33cd30cd496a30 /cmake/modules | |
parent | c05d11204d69eef7ac7a7899d9a771a488a4896c (diff) |
CMake: Reformat UseLemon.cmake
Replace spaces with tabs and use lower-case CMake names to
match our usual style.
Diffstat (limited to 'cmake/modules')
-rw-r--r-- | cmake/modules/UseLemon.cmake | 65 |
1 files changed, 33 insertions, 32 deletions
diff --git a/cmake/modules/UseLemon.cmake b/cmake/modules/UseLemon.cmake index 056d9f9c5d..0f9d8792b9 100644 --- a/cmake/modules/UseLemon.cmake +++ b/cmake/modules/UseLemon.cmake @@ -1,36 +1,37 @@ # -MACRO(ADD_LEMON_FILES _source _generated) - set(_lemonpardir ${CMAKE_SOURCE_DIR}/tools/lemon) - FOREACH (_current_FILE ${ARGN}) - GET_FILENAME_COMPONENT(_in ${_current_FILE} ABSOLUTE) - GET_FILENAME_COMPONENT(_basename ${_current_FILE} NAME_WE) +macro(ADD_LEMON_FILES _source _generated) + set(_lemonpardir ${CMAKE_SOURCE_DIR}/tools/lemon) + foreach (_current_FILE ${ARGN}) + get_filename_component(_in ${_current_FILE} ABSOLUTE) + get_filename_component(_basename ${_current_FILE} NAME_WE) - SET(_out ${CMAKE_CURRENT_BINARY_DIR}/${_basename}) + set(_out ${CMAKE_CURRENT_BINARY_DIR}/${_basename}) - ADD_CUSTOM_COMMAND( - OUTPUT - ${_out}.c - # These files are generated as side-effect - ${_out}.h - ${_out}.out - COMMAND $<TARGET_FILE:lemon> - -T${_lemonpardir}/lempar.c - -d. - ${_in} - DEPENDS - ${_in} - lemon - ${_lemonpardir}/lempar.c - ) + add_custom_command( + OUTPUT + ${_out}.c + # These files are generated as side-effect + ${_out}.h + ${_out}.out + COMMAND $<TARGET_FILE:lemon> + -T${_lemonpardir}/lempar.c + -d. + ${_in} + DEPENDS + ${_in} + lemon + ${_lemonpardir}/lempar.c + ) - LIST(APPEND ${_source} ${_in}) - LIST(APPEND ${_generated} ${_out}.c) - if(CMAKE_C_COMPILER_ID MATCHES "MSVC") - set_source_files_properties(${_out}.c PROPERTIES COMPILE_OPTIONS "/w") - elseif(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") - set_source_files_properties(${_out}.c PROPERTIES COMPILE_OPTIONS "-Wno-unused-parameter") - else() - # Build with some warnings for lemon generated code - endif() - ENDFOREACH (_current_FILE) -ENDMACRO(ADD_LEMON_FILES) + list(APPEND ${_source} ${_in}) + list(APPEND ${_generated} ${_out}.c) + + if(CMAKE_C_COMPILER_ID MATCHES "MSVC") + set_source_files_properties(${_out}.c PROPERTIES COMPILE_OPTIONS "/w") + elseif(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") + set_source_files_properties(${_out}.c PROPERTIES COMPILE_OPTIONS "-Wno-unused-parameter") + else() + # Build with some warnings for lemon generated code + endif() + endforeach(_current_FILE) +endmacro(ADD_LEMON_FILES) |