mirror of
https://github.com/curl/curl.git
synced 2026-08-05 04:36:14 +03:00
build: fix libcurltool with cmake and tunits, related tidy-ups
Sync how libcurltool is built in different modes and build systems. cmake: - build libcurltool with curlx when building shared libcurl. To make it possible to use standard libcurl when linking tunits. Also syncing this with autotools. The remaining difference is that cmake allows to select shared or static for curl tool and tests/examples independently. - fix to link with libcurl instead of libcurlu. To sync with autotools and to link with the standard libcurl for tool unit tests. - fix `source_group()` to always include curlx sources. - add missing 'curlx header files' source group. autotools: - build libcurltool without curlx when building static libcurl in non-unity builds. To avoid double compilation, just to be thrown away at link time. Also to sync with unity builds. both: - sync source order between autotools and cmake. - make sure to pass all headers with both autotools and cmake. This is a no-op with cmake. Maybe a future patch should make sure to not pass those to remove that noise. Ref: #17696 Closes #17727
This commit is contained in:
parent
1ec0da0149
commit
f4649425f2
4 changed files with 32 additions and 24 deletions
|
|
@ -26,7 +26,7 @@ AUTOMAKE_OPTIONS = foreign nostdinc
|
|||
# remove targets if the command fails
|
||||
.DELETE_ON_ERROR:
|
||||
|
||||
# Get CURL_FILES, CURL_CFILES, CURL_HFILES, CURLX_CFILES, CURLX_HFILES, CURL_RCFILES variables
|
||||
# Get CURL_CFILES, CURL_HFILES, CURLX_CFILES, CURLX_HFILES, CURL_RCFILES variables
|
||||
include Makefile.inc
|
||||
|
||||
EXTRA_DIST = mk-file-embed.pl mkhelp.pl \
|
||||
|
|
@ -71,21 +71,24 @@ curl_cfiles_gen =
|
|||
curl_hfiles_gen =
|
||||
CLEANFILES =
|
||||
|
||||
if USE_UNITY
|
||||
if USE_CPPFLAG_CURL_STATICLIB
|
||||
curlx_src =
|
||||
curlx_csrc =
|
||||
curlx_hsrc =
|
||||
else
|
||||
# These are part of the libcurl static lib. Add them here when linking shared.
|
||||
curlx_src = $(CURLX_CFILES)
|
||||
curlx_csrc = $(CURLX_CFILES)
|
||||
curlx_hsrc = $(CURLX_HFILES)
|
||||
endif
|
||||
curltool_unity.c: $(top_srcdir)/scripts/mk-unity.pl $(CURL_CFILES) $(curl_cfiles_gen) $(curlx_src)
|
||||
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(CURL_CFILES) $(curl_cfiles_gen) $(curlx_src) > curltool_unity.c
|
||||
|
||||
if USE_UNITY
|
||||
curltool_unity.c: $(top_srcdir)/scripts/mk-unity.pl $(CURL_CFILES) $(CURL_HFILES) $(curl_cfiles_gen) $(curl_hfiles_gen) $(curlx_csrc) $(curlx_hsrc)
|
||||
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(CURL_CFILES) $(CURL_HFILES) $(curl_cfiles_gen) $(curl_hfiles_gen) $(curlx_csrc) $(curlx_hsrc) > curltool_unity.c
|
||||
|
||||
nodist_curl_SOURCES = curltool_unity.c
|
||||
curl_SOURCES =
|
||||
CLEANFILES += curltool_unity.c
|
||||
else
|
||||
curl_SOURCES = $(CURL_FILES) $(curl_cfiles_gen) $(curl_hfiles_gen)
|
||||
curl_SOURCES = $(CURL_CFILES) $(CURL_HFILES) $(curl_cfiles_gen) $(curl_hfiles_gen) $(curlx_csrc) $(curlx_hsrc)
|
||||
endif
|
||||
if HAVE_WINDRES
|
||||
curl_SOURCES += $(CURL_RCFILES)
|
||||
|
|
@ -109,14 +112,14 @@ libcurltool_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS
|
|||
libcurltool_la_CFLAGS =
|
||||
libcurltool_la_LDFLAGS = -static $(LIBCURL_PC_LIBS_PRIVATE)
|
||||
if USE_UNITY
|
||||
libcurltool_unity.c: $(top_srcdir)/scripts/mk-unity.pl $(CURL_CFILES) $(curlx_src)
|
||||
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(CURL_CFILES) $(curlx_src) > libcurltool_unity.c
|
||||
libcurltool_unity.c: $(top_srcdir)/scripts/mk-unity.pl $(CURL_CFILES) $(CURL_HFILES) $(curlx_csrc) $(curlx_hsrc)
|
||||
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(CURL_CFILES) $(CURL_HFILES) $(curlx_csrc) $(curlx_hsrc) > libcurltool_unity.c
|
||||
|
||||
nodist_libcurltool_la_SOURCES = libcurltool_unity.c
|
||||
libcurltool_la_SOURCES =
|
||||
CLEANFILES += libcurltool_unity.c
|
||||
else
|
||||
libcurltool_la_SOURCES = $(CURL_FILES)
|
||||
libcurltool_la_SOURCES = $(CURL_CFILES) $(CURL_HFILES) $(curlx_csrc) $(curlx_hsrc)
|
||||
endif
|
||||
endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue