Skip to content

Commit 3e1e0dc

Browse files
author
Zsolt Borbély
committed
Move the logic of Valgrind-support check to the CMake part.
Related pull request: #866 JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
1 parent cadc81d commit 3e1e0dc

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ project (Jerry CXX C ASM)
7777

7878
option(STRIP_RELEASE_BINARY "Strip symbols from release binaries" ON)
7979
elseif("${PLATFORM}" STREQUAL "MCU")
80+
if (("${ENABLE_VALGRIND}" STREQUAL "ON") OR ("${ENABLE_VALGRIND_FREYA}" STREQUAL "ON"))
81+
message(FATAL_ERROR "This target isn't supported with Valgrind.")
82+
endif()
83+
8084
set(PLATFORM_EXT "MCU_${CMAKE_SYSTEM_VERSION}")
8185
set(EXTERNAL_BUILD FALSE)
8286

Makefile

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,6 @@ export TARGET_NATIVE_SYSTEMS = $(shell uname -s | tr '[:upper:]' '[:lower:]')
5858
VALGRIND_FREYA := OFF
5959
endif
6060

61-
# Indicate when Valgrind or Valgrind_Freya option is enabled.
62-
VALGRIND_IS_ENABLED ?= OFF
63-
64-
ifneq ($(VALGRIND)$(VALGRIND_FREYA), OFFOFF)
65-
VALGRIND_IS_ENABLED := ON
66-
else
67-
VALGRIND_IS_ENABLED := OFF
68-
endif
69-
7061
# Static checkers
7162
STATIC_CHECK ?= OFF
7263

@@ -222,15 +213,13 @@ $(BUILD_DIRS_NATIVE):
222213

223214
.PHONY: $(BUILD_DIRS_STM32F3)
224215
$(BUILD_DIRS_STM32F3): prerequisites
225-
$(Q) [ "$(VALGRIND_IS_ENABLED)" = "OFF" ] || (echo "Build failed. This target doesn't support build with Valgrind."; exit 1;)
226216
$(Q) mkdir -p $@
227217
$(Q) cd $@ && \
228218
(cmake -DENABLE_VALGRIND=$(VALGRIND) -DENABLE_VALGRIND_FREYA=$(VALGRIND_FREYA) -DENABLE_LTO=$(LTO) -DENABLE_ALL_IN_ONE=$(ALL_IN_ONE) -DCMAKE_TOOLCHAIN_FILE=build/configs/toolchain_mcu_stm32f3.cmake ../../.. 2>&1 | tee cmake.log $(QLOG) ; ( exit $${PIPESTATUS[0]} ) ) || \
229219
(echo "CMake run failed. See "`pwd`"/cmake.log for details."; exit 1;)
230220

231221
.PHONY: $(BUILD_DIRS_STM32F4)
232222
$(BUILD_DIRS_STM32F4): prerequisites
233-
$(Q) [ "$(VALGRIND_IS_ENABLED)" = "OFF" ] || (echo "Build failed. This target doesn't support build with Valgrind."; exit 1;)
234223
$(Q) mkdir -p $@
235224
$(Q) cd $@ && \
236225
(cmake -DENABLE_VALGRIND=$(VALGRIND) -DENABLE_VALGRIND_FREYA=$(VALGRIND_FREYA) -DENABLE_LTO=$(LTO) -DENABLE_ALL_IN_ONE=$(ALL_IN_ONE) -DCMAKE_TOOLCHAIN_FILE=build/configs/toolchain_mcu_stm32f4.cmake ../../.. 2>&1 | tee cmake.log $(QLOG) ; ( exit $${PIPESTATUS[0]} ) ) || \

0 commit comments

Comments
 (0)