Skip to content

Commit 32461ed

Browse files
committed
expose more flags
Use if DEFINED to make sure the flag still setup when it's defined and value to NO IoT.js-DCO-1.0-Signed-off-by: Yonggang Luo [email protected]
1 parent df474aa commit 32461ed

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ if(NOT DEFINED ENABLE_LTO)
5555
set(ENABLE_LTO OFF)
5656
endif()
5757

58+
if(NOT DEFINED JERRY_LINE_INFO)
59+
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
60+
message("Line info default enabled in debug mode")
61+
set(JERRY_LINE_INFO ON)
62+
else()
63+
message("Line info default disabled in non debug mode")
64+
set(JERRY_LINE_INFO OFF)
65+
endif()
66+
endif()
67+
5868
macro(iotjs_add_flags VAR)
5969
foreach(_flag ${ARGN})
6070
set(${VAR} "${${VAR}} ${_flag}")

cmake/jerry.cmake

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ set_property(TARGET jerry-snapshot PROPERTY
7070

7171
# Utility method to add -D<KEY>=<KEY_Value>
7272
macro(add_cmake_arg TARGET_ARG KEY)
73-
if(${KEY})
73+
if(DEFINED ${KEY})
7474
list(APPEND ${TARGET_ARG} -D${KEY}=${${KEY}})
7575
endif()
7676
endmacro(add_cmake_arg)
@@ -112,7 +112,7 @@ endif()
112112

113113
# Add a few cmake options based on buildtype/external cmake defines
114114
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
115-
list(APPEND DEPS_LIB_JERRY_ARGS -DJERRY_ERROR_MESSAGES=ON)
115+
set(JERRY_ERROR_MESSAGES ON)
116116
endif()
117117

118118
# NuttX is not using the default port implementation of JerryScript
@@ -174,8 +174,6 @@ ExternalProject_Add(libjerry
174174
-DJERRY_LOGGING=ON
175175
-DJERRY_LINE_INFO=${JERRY_LINE_INFO}
176176
-DJERRY_VM_EXEC_STOP=ON
177-
-DJERRY_ERROR_MESSAGES=ON
178-
-DENABLE_LTO=${ENABLE_LTO}
179177
${DEPS_LIB_JERRY_ARGS}
180178
${EXTRA_JERRY_CMAKE_PARAMS}
181179
BUILD_BYPRODUCTS ${JERRY_LIB_BUILD_BYPRODUCTS}

0 commit comments

Comments
 (0)