compile_commands.json should be generated for the whole project (#4503)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
@@ -62,6 +62,7 @@ set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libraries?")
|
||||
set(ENABLE_AMALGAM OFF CACHE BOOL "Enable amalgamated build?")
|
||||
set(ENABLE_LTO ON CACHE BOOL "Enable LTO build?")
|
||||
set(ENABLE_STRIP ON CACHE BOOL "Enable stripping all symbols from release binary?")
|
||||
set(ENABLE_COMPILE_COMMANDS ON CACHE BOOL "Enable generating compile_commands.json?")
|
||||
|
||||
# Option overrides
|
||||
if(NOT USING_CLANG)
|
||||
@@ -116,6 +117,9 @@ if(CYGWIN OR MINGW OR MSYS)
|
||||
set(ENABLE_LTO_MESSAGE " (FORCED BY PLATFORM)")
|
||||
endif()
|
||||
|
||||
# Generate compile_commands.json
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ${ENABLE_COMPILE_COMMANDS})
|
||||
|
||||
# Status messages
|
||||
message(STATUS "CMAKE_BUILD_TYPE " ${CMAKE_BUILD_TYPE})
|
||||
message(STATUS "CMAKE_C_COMPILER_ID " ${CMAKE_C_COMPILER_ID})
|
||||
@@ -125,6 +129,7 @@ message(STATUS "BUILD_SHARED_LIBS " ${BUILD_SHARED_LIBS})
|
||||
message(STATUS "ENABLE_AMALGAM " ${ENABLE_AMALGAM} ${ENABLE_AMALGAM_MESSAGE})
|
||||
message(STATUS "ENABLE_LTO " ${ENABLE_LTO} ${ENABLE_LTO_MESSAGE})
|
||||
message(STATUS "ENABLE_STRIP " ${ENABLE_STRIP} ${ENABLE_STRIP_MESSAGE})
|
||||
message(STATUS "ENABLE_COMPILE_COMMANDS " ${ENABLE_COMPILE_COMMANDS})
|
||||
message(STATUS "JERRY_VERSION " ${JERRY_VERSION})
|
||||
message(STATUS "JERRY_CMDLINE " ${JERRY_CMDLINE} ${JERRY_CMDLINE_MESSAGE})
|
||||
message(STATUS "JERRY_CMDLINE_TEST " ${JERRY_CMDLINE_TEST} ${JERRY_CMDLINE_TEST_MESSAGE})
|
||||
|
||||
@@ -17,12 +17,10 @@ project (jerry-main C)
|
||||
|
||||
# Optional build settings
|
||||
set(ENABLE_LINK_MAP OFF CACHE BOOL "Enable generating a link map file?")
|
||||
set(ENABLE_COMPILE_COMMANDS ON CACHE BOOL "Enable generating compile_commands.json?")
|
||||
set(JERRY_TEST_STACK_MEASURE OFF CACHE BOOL "Enable stack measurement for the jerry-test binary?")
|
||||
|
||||
# Status messages
|
||||
message(STATUS "ENABLE_LINK_MAP " ${ENABLE_LINK_MAP})
|
||||
message(STATUS "ENABLE_COMPILE_COMMANDS " ${ENABLE_COMPILE_COMMANDS})
|
||||
message(STATUS "JERRY_TEST_STACK_MEASURE " ${JERRY_TEST_STACK_MEASURE})
|
||||
|
||||
# Generate map file
|
||||
@@ -34,9 +32,6 @@ if(ENABLE_LINK_MAP)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Generate compile_commands.json
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ${ENABLE_COMPILE_COMMANDS})
|
||||
|
||||
# Get version information from git
|
||||
if(IS_DIRECTORY "${CMAKE_SOURCE_DIR}/.git")
|
||||
execute_process(COMMAND git rev-parse --short HEAD
|
||||
|
||||
Reference in New Issue
Block a user