Skip to content

Commit 9450e23

Browse files
committed
Support run or test target invoked within debugger
Useful, as it gets all the environment produced by the makefile. For the test target, it might make sense to have the child process debug plugin for VS installed.
1 parent ff8a6b1 commit 9450e23

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

win32/build/Makefile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ MCFILE=$(BUILD_DIR)\wsyslog.rc
2929
BUILD_DIR_DEV_NAME=php-$(PHP_VERSION_STRING)-devel-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE)
3030
BUILD_DIR_DEV=$(BUILD_DIR)\$(BUILD_DIR_DEV_NAME)
3131

32+
!if "$(DEBUGGER)" == "1"
33+
DEBUGGER_CMD=devenv
34+
DEBUGGER_ARGS=/debugexe
35+
!else
36+
DEBUGGER_CMD=
37+
DEBUGGER_ARGS=
38+
!endif
39+
3240
all: generated_files $(EXT_TARGETS) $(PECL_TARGETS) $(SAPI_TARGETS)
3341

3442
build_dirs: $(BUILD_DIR) $(BUILD_DIRS_SUB) $(BUILD_DIR_DEV)
@@ -151,18 +159,19 @@ clean-pgo: clean-all
151159
-del /f /q $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip
152160
-del /f /q $(BUILD_DIR)\php-test-pack-$(PHP_VERSION_STRING).zip
153161

162+
154163
!if $(PHP_TEST_INI_PATH) == ""
155164
test: set-tmp-env
156-
"$(BUILD_DIR)\php.exe" -d open_basedir= -d output_buffering=0 run-tests.php $(TESTS) -p "$(BUILD_DIR)\php.exe"
165+
$(DEBUGGER_CMD) $(DEBUGGER_ARGS) "$(BUILD_DIR)\php.exe" -d open_basedir= -d output_buffering=0 run-tests.php $(TESTS) -p "$(BUILD_DIR)\php.exe"
157166

158167
run: set-tmp-env
159-
"$(BUILD_DIR)\php.exe" $(ARGS)
168+
$(DEBUGGER_CMD) $(DEBUGGER_ARGS) "$(BUILD_DIR)\php.exe" $(ARGS)
160169
!else
161170
test: set-tmp-env
162-
"$(BUILD_DIR)\php.exe" -n -c $(PHP_TEST_INI_PATH) -d open_basedir= -d output_buffering=0 -d memory_limit=-1 run-tests.php -p "$(BUILD_DIR)\php.exe" -n -c $(PHP_TEST_INI_PATH) $(TESTS)
171+
$(DEBUGGER_CMD) $(DEBUGGER_ARGS) "$(BUILD_DIR)\php.exe" -n -c $(PHP_TEST_INI_PATH) -d open_basedir= -d output_buffering=0 -d memory_limit=-1 run-tests.php -p "$(BUILD_DIR)\php.exe" -n -c $(PHP_TEST_INI_PATH) $(TESTS)
163172

164173
run: set-tmp-env
165-
"$(BUILD_DIR)\php.exe" -n -c $(PHP_TEST_INI_PATH) $(ARGS)
174+
$(DEBUGGER_CMD) $(DEBUGGER_ARGS) "$(BUILD_DIR)\php.exe" -n -c $(PHP_TEST_INI_PATH) $(ARGS)
166175
!endif
167176

168177
build-snap: set-tmp-env generated_files

0 commit comments

Comments
 (0)