]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
build: tidy up header paths, use srcdir where possible
authorViktor Szakats <commit@vsz.me>
Sat, 14 Jun 2025 15:06:58 +0000 (17:06 +0200)
committerViktor Szakats <commit@vsz.me>
Thu, 19 Jun 2025 11:27:17 +0000 (13:27 +0200)
To improve readability.

Also add more comments on why each is necessary.

Closes #17630

13 files changed:
lib/Makefile.am
src/CMakeLists.txt
src/Makefile.am
tests/client/CMakeLists.txt
tests/client/Makefile.am
tests/libtest/CMakeLists.txt
tests/libtest/Makefile.am
tests/server/CMakeLists.txt
tests/server/Makefile.am
tests/tunit/CMakeLists.txt
tests/tunit/Makefile.am
tests/unit/CMakeLists.txt
tests/unit/Makefile.am

index 95d86558bc0c06ef3172b961e85b47f4485e1ebf..33d505959be0333ff534e78ed18744ccaac82488 100644 (file)
@@ -50,6 +50,7 @@ CFLAGS += @CURL_CFLAG_EXTRAS@
 #
 # $(top_srcdir)/include is for libcurl's external include files
 # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
+# $(srcdir) for the generated unity source to find included sources
 
 AM_CPPFLAGS = -I$(top_srcdir)/include   \
               -I$(top_builddir)/lib     \
index 8e0ab9fd4a795b7f096377f933274dd3dbbc06e6..bdf245ffa6a71ece1ff0c15fb7b71cfabb91bf26 100644 (file)
@@ -79,11 +79,10 @@ if(BUILD_STATIC_CURL)
 endif()
 
 set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES
-  "${PROJECT_BINARY_DIR}/lib"  # for "curl_config.h"
-  "${PROJECT_SOURCE_DIR}/lib"  # for "curl_setup.h"
+  "${PROJECT_BINARY_DIR}/lib"        # for "curl_config.h"
+  "${PROJECT_SOURCE_DIR}/lib"        # for "curl_setup.h"
   "${PROJECT_SOURCE_DIR}/lib/curlx"  # for curlx functions
-  # This is needed as tool_hugehelp.c is generated in the binary dir
-  "${PROJECT_SOURCE_DIR}/src"  # for "tool_hugehelp.h"
+  "${CMAKE_CURRENT_SOURCE_DIR}"      # for "tool_hugehelp.c"
 )
 
 add_executable(${EXE_NAME} ${CURL_CFILES} ${_curl_cfiles_gen} ${CURLX_CFILES} ${CURL_HFILES} ${_curl_hfiles_gen})
index a2a9968ea05338abe695acdcc519e2a82c78ceef..a6a743a081fc06d16c0305cb738dff4ea52d1f61 100644 (file)
@@ -38,14 +38,14 @@ EXTRA_DIST = mk-file-embed.pl mkhelp.pl \
 # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
 # $(top_builddir)/src is for curl's generated src/curl_config.h file
 # $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "borrowed" files
-# $(top_srcdir)/src is for curl's src/tool_setup.h and "curl-private" files
+# $(srcdir) for generated sources to find included sources
 
 AM_CPPFLAGS = -I$(top_srcdir)/include        \
               -I$(top_builddir)/lib          \
               -I$(top_builddir)/src          \
               -I$(top_srcdir)/lib            \
               -I$(top_srcdir)/lib/curlx      \
-              -I$(top_srcdir)/src
+              -I$(srcdir)
 
 bin_PROGRAMS = curl
 
index 167b55c969cd3d53e9274fb5488be38f5205dae0..ed0db246d58997098fe573e7fd0dfe4df5e2328e 100644 (file)
@@ -47,7 +47,7 @@ target_include_directories(${BUNDLE} PRIVATE
   "${PROJECT_BINARY_DIR}/lib"            # for "curl_config.h"
   "${PROJECT_SOURCE_DIR}/lib"            # for "curl_setup.h"
   "${PROJECT_SOURCE_DIR}/lib/curlx"      # for curlx
-  "${CMAKE_CURRENT_SOURCE_DIR}"          # for "first.h"
+  "${CMAKE_CURRENT_SOURCE_DIR}"          # for the generated bundle source to find included test sources
 )
 set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_NO_OLDIES")
 set_target_properties(${BUNDLE} PROPERTIES OUTPUT_NAME "${BUNDLE}" PROJECT_LABEL "Test ${BUNDLE}" UNITY_BUILD OFF)
index e8ed64b012336bd991d58f5f96faf454634dfd6c..54f8779046a7e5771623a2ff120847635faa5085 100644 (file)
@@ -31,6 +31,7 @@ AUTOMAKE_OPTIONS = foreign nostdinc
 # $(top_srcdir)/include is for libcurl's external include files
 # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
 # $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "borrowed" files
+# $(srcdir) for the generated bundle source to find included test sources
 
 AM_CPPFLAGS = -I$(top_srcdir)/include        \
               -I$(top_builddir)/lib          \
index 45a533acaac5f6d3896ea2de92e02f8b5f510255..1d485d17d80a01dd373d64984f62b615957b48b5 100644 (file)
@@ -55,8 +55,8 @@ target_include_directories(${BUNDLE} PRIVATE
   "${PROJECT_SOURCE_DIR}/lib"            # for "curl_setup.h"
   "${PROJECT_SOURCE_DIR}/lib/curlx"      # for curlx
   "${PROJECT_SOURCE_DIR}/src"            # for "tool_binmode.h"
-  "${PROJECT_SOURCE_DIR}/tests/libtest"  # to be able to build generated tests
-  "${PROJECT_SOURCE_DIR}/tests/unit"     # for curlcheck.h
+  "${CMAKE_CURRENT_SOURCE_DIR}"          # for the generated bundle source to find included test sources
+  "${PROJECT_SOURCE_DIR}/tests/unit"     # for "curlcheck.h"
 )
 set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "${CURL_DEBUG_MACROS}")
 set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_NO_OLDIES" "CURL_DISABLE_DEPRECATION")
index 1047937617366f314816551a0cb7e989d5ef1746..0db7a0e349085e3615a647b4d191bf9b2034a67d 100644 (file)
@@ -31,13 +31,14 @@ AUTOMAKE_OPTIONS = foreign nostdinc
 # $(top_srcdir)/include is for libcurl's external include files
 # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
 # $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "borrowed" files
+# $(srcdir) for the generated bundle source to find included test sources
 
 AM_CPPFLAGS = -I$(top_srcdir)/include        \
               -I$(top_builddir)/lib          \
               -I$(top_srcdir)/lib            \
               -I$(top_srcdir)/lib/curlx      \
               -I$(top_srcdir)/src            \
-              -I$(top_srcdir)/tests/libtest  \
+              -I$(srcdir)                    \
               -I$(top_srcdir)/tests/unit
 
 # Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, CURLX_SRCS, TESTFILES variables
index c0be8a96c28f4331e93586b1409c122b12d92f67..4ad9cc55fecb7b8e790a481e0ddb90630a9735ed 100644 (file)
@@ -39,11 +39,11 @@ add_executable(${BUNDLE} EXCLUDE_FROM_ALL "${BUNDLE_SRC}")
 add_dependencies(testdeps ${BUNDLE})
 target_link_libraries(${BUNDLE} ${CURL_LIBS})
 target_include_directories(${BUNDLE} PRIVATE
-  "${PROJECT_BINARY_DIR}/lib"           # for "curl_config.h"
-  "${PROJECT_SOURCE_DIR}/lib"           # for "curl_setup.h"
-  "${PROJECT_SOURCE_DIR}/lib/curlx"     # for curlx
-  "${PROJECT_SOURCE_DIR}/src"           # for "tool_binmode.h", "tool_xattr.h"
-  "${PROJECT_SOURCE_DIR}/tests/server"  # for "first.h"
+  "${PROJECT_BINARY_DIR}/lib"            # for "curl_config.h"
+  "${PROJECT_SOURCE_DIR}/lib"            # for "curl_setup.h"
+  "${PROJECT_SOURCE_DIR}/lib/curlx"      # for curlx
+  "${PROJECT_SOURCE_DIR}/src"            # for "tool_binmode.h", "tool_xattr.h"
+  "${CMAKE_CURRENT_SOURCE_DIR}"          # for the generated bundle source to find included test sources
 )
 set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "WITHOUT_LIBCURL")
 set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_NO_OLDIES")
index c8b8408807092a3a54fc06d12ddee436972b06e9..36b40084372160b0a466663a7b1fd5660beb0251 100644 (file)
@@ -32,13 +32,14 @@ AUTOMAKE_OPTIONS = foreign nostdinc
 # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
 # $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "borrowed" files
 # $(top_srcdir)/src for "tool_binmode.h", "tool_xattr.h"
+# $(srcdir) for the generated bundle source to find included test sources
 
 AM_CPPFLAGS = -I$(top_srcdir)/include        \
               -I$(top_builddir)/lib          \
               -I$(top_srcdir)/lib            \
               -I$(top_srcdir)/lib/curlx      \
               -I$(top_srcdir)/src            \
-              -I$(top_srcdir)/tests/server
+              -I$(srcdir)
 
 # Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, CURLX_SRCS, TESTFILES variables
 include Makefile.inc
index 0ba777ba334a18d0970bda55f02f8c3577ff8208..0b12e6210be17065076b950b3ac47ebb51246795 100644 (file)
@@ -40,10 +40,10 @@ target_include_directories(${BUNDLE} PRIVATE
   "${PROJECT_BINARY_DIR}/lib"            # for "curl_config.h"
   "${PROJECT_SOURCE_DIR}/lib"            # for "curl_setup.h"
   "${PROJECT_SOURCE_DIR}/lib/curlx"      # for curlx
-  "${PROJECT_SOURCE_DIR}/src"
-  "${PROJECT_SOURCE_DIR}/tests/libtest"
-  "${PROJECT_SOURCE_DIR}/tests/unit"     # for curlcheck.h
-  "${PROJECT_SOURCE_DIR}/tests/tunit"
+  "${PROJECT_SOURCE_DIR}/src"            # for tool headers
+  "${PROJECT_SOURCE_DIR}/tests/libtest"  # for "first.h"
+  "${PROJECT_SOURCE_DIR}/tests/unit"     # for "curlcheck.h"
+  "${CMAKE_CURRENT_SOURCE_DIR}"          # for the generated bundle source to find included test sources
 )
 set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "${CURL_DEBUG_MACROS}")
 set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_NO_OLDIES" "CURL_DISABLE_DEPRECATION")
index 53ea0d7b9d4f3ca8e537bd7c33fd248c875485b8..a81f1bb39bb065d8b9fe4d358c4b4092a904c04e 100644 (file)
@@ -31,6 +31,7 @@ AUTOMAKE_OPTIONS = foreign nostdinc
 # $(top_srcdir)/include is for libcurl's external include files
 # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
 # $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "borrowed" files
+# $(srcdir) for the generated bundle source to find included test sources
 
 AM_CPPFLAGS = -I$(top_srcdir)/include        \
               -I$(top_builddir)/lib          \
@@ -39,7 +40,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include        \
               -I$(top_srcdir)/src            \
               -I$(top_srcdir)/tests/libtest  \
               -I$(top_srcdir)/tests/unit     \
-              -I$(top_srcdir)/tests/tunit
+              -I$(srcdir)
 
 # Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, TESTFILES variables
 include Makefile.inc
index 1b9d2f1be3558e87dbb2d8534e10c9110d402b16..5d776e8544e92a2d656bec2560d19a4d346de2dc 100644 (file)
@@ -40,9 +40,9 @@ target_include_directories(${BUNDLE} PRIVATE
   "${PROJECT_BINARY_DIR}/lib"            # for "curl_config.h"
   "${PROJECT_SOURCE_DIR}/lib"            # for "curl_setup.h"
   "${PROJECT_SOURCE_DIR}/lib/curlx"      # for curlx
-  "${PROJECT_SOURCE_DIR}/src"
-  "${PROJECT_SOURCE_DIR}/tests/libtest"
-  "${PROJECT_SOURCE_DIR}/tests/unit"
+  "${PROJECT_SOURCE_DIR}/src"            # for "tool_binmode.h"
+  "${PROJECT_SOURCE_DIR}/tests/libtest"  # for "first.h"
+  "${CMAKE_CURRENT_SOURCE_DIR}"          # for the generated bundle source to find included test sources
 )
 set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "${CURL_DEBUG_MACROS}")
 set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_NO_OLDIES" "CURL_DISABLE_DEPRECATION")
index e50b33e952703595a012fb86d059610a22d813de..e3cf2cc4a062ee34ced466ed17f68c54c70f24d0 100644 (file)
@@ -31,6 +31,7 @@ AUTOMAKE_OPTIONS = foreign nostdinc
 # $(top_srcdir)/include is for libcurl's external include files
 # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
 # $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "borrowed" files
+# $(srcdir) for the generated bundle source to find included test sources
 
 AM_CPPFLAGS = -I$(top_srcdir)/include        \
               -I$(top_builddir)/lib          \
@@ -38,7 +39,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include        \
               -I$(top_srcdir)/lib/curlx      \
               -I$(top_srcdir)/src            \
               -I$(top_srcdir)/tests/libtest  \
-              -I$(top_srcdir)/tests/unit
+              -I$(srcdir)
 
 # Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, TESTFILES variables
 include Makefile.inc