Add lightweight command line processor to jerry-main (#1809)

Eases command line option and sub-command definition, usage summary
and detailed help message printing, and argv processing.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
Akos Kiss
2017-05-16 10:29:27 +02:00
committed by GitHub
parent 1501699f48
commit 7837440cbb
5 changed files with 757 additions and 139 deletions
+3 -3
View File
@@ -43,8 +43,8 @@ endif()
set(DEFINES_JERRY ${DEFINES_JERRY} JERRY_COMMIT_HASH="${JERRY_COMMIT_HASH}")
macro(jerry_create_executable JERRY_NAME SOURCE_JERRY_STANDALONE_MAIN)
add_executable(${JERRY_NAME} ${SOURCE_JERRY_STANDALONE_MAIN})
macro(jerry_create_executable JERRY_NAME)
add_executable(${JERRY_NAME} ${ARGN})
set_property(TARGET ${JERRY_NAME}
PROPERTY LINK_FLAGS "${LINKER_FLAGS_COMMON}")
target_compile_definitions(${JERRY_NAME} PRIVATE ${DEFINES_JERRY})
@@ -57,7 +57,7 @@ endmacro()
# Jerry standalones
if(JERRY_CMDLINE)
jerry_create_executable("jerry" "main-unix.c")
jerry_create_executable("jerry" "main-unix.c" "cli.c")
target_link_libraries("jerry" jerry-ext jerry-port-default)
endif()