Skip to content

Commit

Permalink
pythongh-96269: static and shared ext need different deps (python#96316)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiran authored Nov 16, 2022
1 parent 3ed8803 commit 33f42c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -2572,7 +2572,9 @@ Python/thread.o: @THREADHEADERS@ $(srcdir)/Python/condvar.h
##########################################################################
# Module dependencies and platform-specific files

MODULE_DEPS=$(PYTHON_HEADERS) Modules/config.c $(EXPORTSYMS)
# force rebuild when header file or module build flavor (static/shared) is changed
MODULE_DEPS_STATIC=Modules/config.c
MODULE_DEPS_SHARED=$(MODULE_DEPS_STATIC) $(EXPORTSYMS)

MODULE_CMATH_DEPS=$(srcdir)/Modules/_math.h
MODULE_MATH_DEPS=$(srcdir)/Modules/_math.h
Expand Down
11 changes: 7 additions & 4 deletions Modules/makesetup
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,15 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
esac
# custom flags first, PY_STDMODULE_CFLAGS may contain -I with system libmpdec
case $doconfig in
no) cc="$cc $cpps \$(PY_STDMODULE_CFLAGS) \$(CCSHARED)";;
no)
cc="$cc $cpps \$(PY_STDMODULE_CFLAGS) \$(CCSHARED)"
rule="$obj: $src \$(MODULE_${mods_upper}_DEPS) \$(MODULE_DEPS_SHARED) \$(PYTHON_HEADERS); $cc -c $src -o $obj"
;;
*)
cc="$cc $cpps \$(PY_BUILTIN_MODULE_CFLAGS)";;
cc="$cc $cpps \$(PY_BUILTIN_MODULE_CFLAGS)"
rule="$obj: $src \$(MODULE_${mods_upper}_DEPS) \$(MODULE_DEPS_STATIC) \$(PYTHON_HEADERS); $cc -c $src -o $obj"
;;
esac
# force rebuild when header file or module build flavor (static/shared) is changed
rule="$obj: $src \$(MODULE_${mods_upper}_DEPS) \$(MODULE_DEPS); $cc -c $src -o $obj"
echo "$rule" >>$rulesf
done
case $doconfig in
Expand Down

0 comments on commit 33f42c2

Please sign in to comment.