diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2017-11-19 00:20:20 +0000 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-11-20 06:03:08 +0000 |
commit | fe0c2b04853226b64a1aa17fbef6257c856e3fd9 (patch) | |
tree | d09f8b8c6fc44b402a17ab09d3d061311cccfb7f /cmake | |
parent | 129cb60f56f42e58b9e589d79ac3ee317066d43e (diff) |
Rewrite make-dissector-reg.py in C
The output compares equal to make-dissector-reg.py and the regex
should be more robust (multiline, complete start of function definition).
The primary motivation is to clean up the python script. This small
binary results in much cleaner code. The python script is used only
to generate plugin code, therefore it is renamed.
Also in my casual measurements the C code is much faster (without cache)
than the python script with the cache.
Change-Id: Id4e8cac3c836d56775aba4819357a95ef19bcb85
Reviewed-on: https://code.wireshark.org/review/24497
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/UseMakeDissectorReg.cmake | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/cmake/modules/UseMakeDissectorReg.cmake b/cmake/modules/UseMakeDissectorReg.cmake index d805ef20e1..7b93457e21 100644 --- a/cmake/modules/UseMakeDissectorReg.cmake +++ b/cmake/modules/UseMakeDissectorReg.cmake @@ -1,32 +1,21 @@ # MACRO(REGISTER_DISSECTOR_FILES _outputfile _registertype ) include(LocatePythonModule) - locate_python_module(make-dissector-reg REQUIRED PATHS ${CMAKE_SOURCE_DIR}/tools) + locate_python_module(make-plugin-reg REQUIRED PATHS ${CMAKE_SOURCE_DIR}/tools) - if(${_registertype} STREQUAL "dissectors" ) - set( _makeregistertype "dissectorsinfile" ) - set( _ftmp "${CMAKE_CURRENT_BINARY_DIR}/_regc.tmp" ) - set( _depends ${ARGN} ) - file(REMOVE ${_ftmp}) - foreach(f ${_depends}) - file(APPEND ${_ftmp} "${f}\n") - endforeach() - set( _sources ${_ftmp} ) - else() - set( _makeregistertype ${_registertype} ) - set( _sources ${ARGN} ) - set( _depends ${_sources} ) - endif() + set( _makeregistertype ${_registertype} ) + set( _sources ${ARGN} ) + set( _depends ${_sources} ) ADD_CUSTOM_COMMAND( OUTPUT ${_outputfile} COMMAND ${PYTHON_EXECUTABLE} - ${PY_MAKE-DISSECTOR-REG} + ${PY_MAKE-PLUGIN-REG} ${CMAKE_CURRENT_SOURCE_DIR} ${_makeregistertype} ${_sources} DEPENDS ${_depends} - ${PY_MAKE-DISSECTOR-REG} + ${PY_MAKE-PLUGIN-REG} ) ENDMACRO(REGISTER_DISSECTOR_FILES) |