Fix MSVS builds for unit test changes
Update the Visual Studio builds to support the new monolithic unit
test binary.
Includes minor semi-cosmetic refactoring of solution.mk, as the
%vpx.vcproj match is no longer appropriate given the test_libvpx
target.
Change-Id: I29e6e07c39e72b54a4b3eaca5b9b7877ef3fb134
diff --git a/libs.mk b/libs.mk
index 516e6d8..fbeef90 100644
--- a/libs.mk
+++ b/libs.mk
@@ -369,25 +369,20 @@
PROJECTS-$(CONFIG_MSVS) += gtest.vcproj
-define unit_test_vcproj_template
-$(notdir $(1:.cc=.vcproj)): $(SRC_PATH_BARE)/$(1)
- @echo " [vcproj] $$@"
- $$(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh\
- --exe\
- --target=$$(TOOLCHAIN)\
- --name=$(notdir $(1:.cc=))\
- --ver=$$(CONFIG_VS_VERSION)\
- $$(if $$(CONFIG_STATIC_MSVCRT),--static-crt) \
- --out=$$@ $$(INTERNAL_CFLAGS) $$(CFLAGS) \
+test_libvpx.vcproj: $(LIBVPX_TEST_SRCS)
+ @echo " [CREATE] $@"
+ $(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh \
+ --exe \
+ --target=$(TOOLCHAIN) \
+ --name=test_libvpx \
+ --proj-guid=CD837F5F-52D8-4314-A370-895D614166A7 \
+ --ver=$(CONFIG_VS_VERSION) \
+ $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
+ --out=$@ $(INTERNAL_CFLAGS) $(CFLAGS) \
-I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \
- -L. -l$(CODEC_LIB) -lwinmm -l$(GTEST_LIB) $$^
-endef
+ -L. -l$(CODEC_LIB) -lwinmm -l$(GTEST_LIB) $^
-$(foreach proj,$(LIBVPX_TEST_BINS),\
- $(eval $(call unit_test_vcproj_template,$(proj))))
-
-PROJECTS-$(CONFIG_MSVS) += $(foreach proj,$(LIBVPX_TEST_BINS),\
- $(notdir $(proj:.cc=.vcproj)))
+PROJECTS-$(CONFIG_MSVS) += test_libvpx.vcproj
test::
@set -e; for t in $(addprefix Win32/Release/,$(notdir $(LIBVPX_TEST_BINS:.cc=.exe))); do $$t; done
diff --git a/solution.mk b/solution.mk
index 2de1d8d..948305f 100644
--- a/solution.mk
+++ b/solution.mk
@@ -8,18 +8,19 @@
## be found in the AUTHORS file in the root of the source tree.
##
+# libvpx reverse dependencies (targets that depend on libvpx)
+VPX_NONDEPS=$(addsuffix .vcproj,vpx gtest obj_int_extract)
+VPX_RDEPS=$(foreach vcp,\
+ $(filter-out $(VPX_NONDEPS),$^), --dep=$(vcp:.vcproj=):vpx)
vpx.sln: $(wildcard *.vcproj)
@echo " [CREATE] $@"
$(SRC_PATH_BARE)/build/make/gen_msvs_sln.sh \
- $(if $(filter %vpx.vcproj,$^),\
- $(foreach vcp,$(filter-out %vpx.vcproj %gtest.vcproj %obj_int_extract.vcproj,$^),\
- --dep=$(vcp:.vcproj=):vpx) \
- $(foreach vcp,$(filter %_test.vcproj,$^),\
- --dep=$(vcp:.vcproj=):gtest)) \
- --dep=vpx:obj_int_extract \
- --ver=$(CONFIG_VS_VERSION)\
- --out=$@ $^
+ $(if $(filter vpx.vcproj,$^),$(VPX_RDEPS)) \
+ --dep=vpx:obj_int_extract \
+ --dep=test_libvpx:gtest \
+ --ver=$(CONFIG_VS_VERSION)\
+ --out=$@ $^
vpx.sln.mk: vpx.sln
@true