Skip to content

Commit 9d59e35

Browse files
committed
uv: Suppress a warning by using an absolute path
Turns out libuv's build system doesn't like us telling them that the build directory is a relative location, as it always spits out a warning about a circular dependency being dropped. By using an absolute path, turns out the warnings isn't spit out, who knew? Closes #11067
1 parent b760ed6 commit 9d59e35

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

mk/rt.mk

+17-6
Original file line numberDiff line numberDiff line change
@@ -186,25 +186,34 @@ else
186186
endif
187187

188188
LIBUV_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),uv)
189-
LIBUV_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/libuv/$$(LIBUV_NAME_$(1))
189+
LIBUV_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/libuv
190+
LIBUV_LIB_$(1) := $$(LIBUV_DIR_$(1))/$$(LIBUV_NAME_$(1))
190191

191192
LIBUV_MAKEFILE_$(1) := $$(CFG_BUILD_DIR)$$(RT_OUTPUT_DIR_$(1))/libuv/Makefile
192193

194+
LIBUV_STAMP_$(1) = $$(LIBUV_DIR_$(1))/libuv-auto-clean-stamp
195+
196+
$$(LIBUV_STAMP_$(1)): $(S)src/rt/libuv-auto-clean-trigger
197+
$$(Q)rm -rf $$(LIBUV_DIR_$(1))
198+
$$(Q)mkdir -p $$(@D)
199+
touch $$@
200+
193201
# libuv triggers a few warnings on some platforms
194202
LIBUV_CFLAGS_$(1) := $(subst -Werror,,$(CFG_GCCISH_CFLAGS_$(1)))
195203

196-
$$(LIBUV_MAKEFILE_$(1)): $$(LIBUV_DEPS)
204+
$$(LIBUV_MAKEFILE_$(1)): $$(LIBUV_DEPS) $$(MKFILE_DEPS) $$(LIBUV_STAMP_$(1))
197205
(cd $(S)src/libuv/ && \
198206
$$(CFG_PYTHON) ./gyp_uv.py -f make -Dtarget_arch=$$(LIBUV_ARCH_$(1)) \
199207
-D ninja \
200208
-DOS=$$(LIBUV_OSTYPE_$(1)) \
201209
-Goutput_dir=$$(@D) --generator-output $$(@D))
210+
touch $$@
202211

203212
# Windows has a completely different build system for libuv because of mingw. In
204213
# theory when we support msvc then we should be using gyp's msvc output instead
205214
# of mingw's makefile for windows
206215
ifdef CFG_WINDOWSY_$(1)
207-
$$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS)
216+
$$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS) $$(MKFILE_DEPS)
208217
$$(Q)$$(MAKE) -C $$(S)src/libuv -f Makefile.mingw \
209218
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS_$(1))" \
210219
CC="$$(CC_$(1)) $$(LIBUV_CFLAGS_$(1)) $$(SNAP_DEFINES)" \
@@ -213,15 +222,17 @@ $$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS)
213222
V=$$(VERBOSE)
214223
$$(Q)cp $$(S)src/libuv/libuv.a $$@
215224
else
216-
$$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1))
217-
$$(Q)$$(MAKE) -C $$(@D) \
225+
$$(LIBUV_LIB_$(1)): $$(LIBUV_DIR_$(1))/Release/libuv.a $$(MKFILE_DEPS)
226+
$$(Q)ln -f $$< $$@
227+
$$(LIBUV_DIR_$(1))/Release/libuv.a: $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)) \
228+
$$(MKFILE_DEPS)
229+
$$(Q)$$(MAKE) -C $$(LIBUV_DIR_$(1)) \
218230
CFLAGS="$$(LIBUV_CFLAGS_$(1)) $$(SNAP_DEFINES)" \
219231
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS_$(1))" \
220232
CC="$$(CC_$(1))" \
221233
CXX="$$(CXX_$(1))" \
222234
AR="$$(AR_$(1))" \
223235
$$(LIBUV_ARGS_$(1)) \
224-
builddir="." \
225236
BUILDTYPE=Release \
226237
NO_LOAD="$$(LIBUV_NO_LOAD)" \
227238
V=$$(VERBOSE)

src/rt/libuv-auto-clean-trigger

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Change the contents of this file to force a full rebuild of libuv
2+
2013-12-23

0 commit comments

Comments
 (0)