diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 00000000..567a90d6 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,12 @@ +version: 2 +updates: + + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly + + - package-ecosystem: pip + directory: / + schedule: + interval: monthly diff --git a/.github/release.yaml b/.github/release.yaml new file mode 100644 index 00000000..0f4884c9 --- /dev/null +++ b/.github/release.yaml @@ -0,0 +1,18 @@ +changelog: + exclude: + labels: + - ignore-for-release + authors: + - dependabot + categories: + - title: Breaking Changes 🛠 + labels: + - semver-major + - breaking-change + - title: New Features 🎉 + labels: + - semver-minor + - enhancement + - title: Other Changes + labels: + - '*' diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 00000000..f77a9010 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,26 @@ +name: Build +on: [push] +jobs: + build: + strategy: + matrix: + ## As of 2023-03-08, our zlib package doesn't support Linux. + os: [windows-2022, macos-11] ##, ubuntu-22.04] + addrsize: ["64"] + include: + - os: windows-2022 + addrsize: "32" + continue-on-error: false + runs-on: ${{ matrix.os }} + steps: + - uses: secondlife/action-autobuild@v3 + with: + addrsize: ${{ matrix.addrsize }} + release: + needs: build + runs-on: [ubuntu-latest] + if: startsWith(github.ref, 'refs/tags/v') + steps: + - uses: secondlife/action-autobuild-release@v1 + with: + public: true diff --git a/autobuild.xml b/autobuild.xml index 5c8cb582..ddd4026a 100755 --- a/autobuild.xml +++ b/autobuild.xml @@ -1,6 +1,5 @@ - - + installables nghttp2 @@ -23,9 +22,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - e4f784d8a035c51921a1562ca7a1bab6 + fff611030a34e78b3a88168f64e4e33aef117bc3 + hash_algorithm + sha1 url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/76357/727350/nghttp2-1.40.0.555524-darwin64-555524.tar.bz2 + https://github.com/secondlife/3p-nghttp2/releases/download/v1.40.0.b1526c6/nghttp2-1.40.0.b1526c6-darwin64-b1526c6.tar.zst name darwin64 @@ -47,9 +48,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - c3c5ff7d2f7ac1143ef8d888192d4a53 + 5798b5f6c8579ad44f211a873c072ee8d3fd8c93 + hash_algorithm + sha1 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/9257/41579/nghttp2-1.25.0.509246-linux64-509246.tar.bz2 + https://github.com/secondlife/3p-nghttp2/releases/download/v1.40.0.b1526c6/nghttp2-1.40.0.b1526c6-linux64-b1526c6.tar.zst name linux64 @@ -59,9 +62,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - af05aa2994c9845308fecd094b7b2d25 + ea16c2b825b69af75c3a64df9e3c24a9021026ca + hash_algorithm + sha1 url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/76359/727360/nghttp2-1.40.0.555524-windows-555524.tar.bz2 + https://github.com/secondlife/3p-nghttp2/releases/download/v1.40.0.b1526c6/nghttp2-1.40.0.b1526c6-windows-b1526c6.tar.zst name windows @@ -71,9 +76,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 5a55cede40eef16b9d1e47c418a2b77a + 05aad7759519719a54a6100fddd35b69e57f2386 + hash_algorithm + sha1 url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/76358/727359/nghttp2-1.40.0.555524-windows64-555524.tar.bz2 + https://github.com/secondlife/3p-nghttp2/releases/download/v1.40.0.b1526c6/nghttp2-1.40.0.b1526c6-windows64-b1526c6.tar.zst name windows64 @@ -82,7 +89,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors source_type hg version - 1.40.0.555524 + 1.40.0.b1526c6 openssl @@ -115,9 +122,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 142d0ad85d0ee4fbb673c9f9e414fbdd + b286e4a10cf6b1b2710b85ff96ffc0e41fd5fde8 + hash_algorithm + sha1 url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/87769/805772/openssl-1.1.1l.563846-darwin64-563846.tar.bz2 + https://github.com/secondlife/3p-openssl/releases/download/v1.1.1q.de53f55/openssl-1.1.1q.de53f55-darwin64-de53f55.tar.zst name darwin64 @@ -139,9 +148,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - d50ccfbf0c1d249392919e2c46ad8d5c + 5f6953db991ef6badb0525ecc98daf28d368e9e7 + hash_algorithm + sha1 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/8339/33495/openssl-1.0.2l.508328-linux64-508328.tar.bz2 + https://github.com/secondlife/3p-openssl/releases/download/v1.1.1q.de53f55/openssl-1.1.1q.de53f55-linux64-de53f55.tar.zst name linux64 @@ -151,9 +162,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 55bd833166d03f1467e2c7f24fa9143e + dbf2f69a7d73821dbe12288097298924e866e606 + hash_algorithm + sha1 url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/87775/805841/openssl-1.1.1l.563846-windows-563846.tar.bz2 + https://github.com/secondlife/3p-openssl/releases/download/v1.1.1q.de53f55/openssl-1.1.1q.de53f55-windows-de53f55.tar.zst name windows @@ -163,16 +176,18 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 6fefc60f68882fc6b246521b696497ab + 8bd3dea6d81de5e469b241a1b79e61efce6ecc05 + hash_algorithm + sha1 url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/87774/805833/openssl-1.1.1l.563846-windows64-563846.tar.bz2 + https://github.com/secondlife/3p-openssl/releases/download/v1.1.1q.de53f55/openssl-1.1.1q.de53f55-windows64-de53f55.tar.zst name windows64 version - 1.1.1l.563846 + 1.1.1q.de53f55 zlib-ng @@ -195,21 +210,39 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - bf306e38bf81c6095e0967bdef6a2445 + dacc5f3fb307c4d1292ed1ffb1d595d83599062d + hash_algorithm + sha1 url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/87759/805718/zlib_ng-2.0.5.563838-darwin64-563838.tar.bz2 + https://github.com/secondlife/3p-zlib-ng/releases/download/v1.2.11.zlib-ng.32fd361/zlib_ng-1.2.11.zlib-ng.32fd361-darwin64-32fd361.tar.zst name darwin64 + linux64 + + archive + + hash + fba88375e12454ae19f4528e11ffc7ddf7d879ec + hash_algorithm + sha1 + url + https://github.com/secondlife/3p-zlib-ng/releases/download/v1.2.11.zlib-ng.32fd361/zlib_ng-1.2.11.zlib-ng.32fd361-linux64-32fd361.tar.zst + + name + linux64 + windows archive hash - 8ffce5bd00e3d5afa8cb39b855237c4a + 2b5a50b0a3d31a07bc74cb77871ad195eb97c550 + hash_algorithm + sha1 url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/87761/805730/zlib_ng-2.0.5.563838-windows-563838.tar.bz2 + https://github.com/secondlife/3p-zlib-ng/releases/download/v1.2.11.zlib-ng.32fd361/zlib_ng-1.2.11.zlib-ng.32fd361-windows-32fd361.tar.zst name windows @@ -219,16 +252,18 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - bd103a9129e57f7ea35886bc7750f8a6 + ccfca9451063e2d0e95baa73b1ad2054d3e38907 + hash_algorithm + sha1 url - https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/87760/805729/zlib_ng-2.0.5.563838-windows64-563838.tar.bz2 + https://github.com/secondlife/3p-zlib-ng/releases/download/v1.2.11.zlib-ng.32fd361/zlib_ng-1.2.11.zlib-ng.32fd361-windows64-32fd361.tar.zst name windows64 version - 2.0.5.563838 + 1.2.11.zlib-ng.32fd361 package_description @@ -367,5 +402,4 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors autobuild version 1.3 - - + diff --git a/build-cmd.sh b/build-cmd.sh index 4396609e..08b2d426 100755 --- a/build-cmd.sh +++ b/build-cmd.sh @@ -14,32 +14,64 @@ if [ -z "$AUTOBUILD" ] ; then fi if [ "$OSTYPE" = "cygwin" ] ; then + # need igncr so cygwin bash will trim both '\r\n' from $(command) + set -o igncr autobuild="$(cygpath -u $AUTOBUILD)" else autobuild="$AUTOBUILD" + # dummy to avoid tedious conditionals everywhere + function cygpath { + # pathname comes last after switches + local last + eval last=\$$# + echo "$last" + } fi -CURL_SOURCE_DIR="curl" -CURL_BUILD_DIR="build" - top="$(pwd)" -stage="$(pwd)/stage" +stage="$top/stage" +CURL_SOURCE_DIR="$top/curl" +CURL_BUILD_DIR="$top/build" # load autobuild provided shell functions and variables source_environment_tempfile="$stage/source_environment.sh" "$autobuild" source_environment > "$source_environment_tempfile" . "$source_environment_tempfile" +# remove_cxxstd +source "$(dirname "$AUTOBUILD_VARIABLES_FILE")/functions" + +# Use msbuild.exe instead of devenv.com +build_sln() { + local solution=$1 + local config=$2 + local proj="${3:-}" + local toolset="${AUTOBUILD_WIN_VSTOOLSET:-v143}" + + # e.g. config = "Release|$AUTOBUILD_WIN_VSPLATFORM" per devenv.com convention + local -a confparts + IFS="|" read -ra confparts <<< "$config" + + msbuild.exe \ + "$(cygpath -w "$solution")" \ + ${proj:+-t:"$proj"} \ + -p:Configuration="${confparts[0]}" \ + -p:Platform="${confparts[1]}" \ + -p:PlatformToolset=$toolset +} + ZLIB_INCLUDE="${stage}"/packages/include/zlib-ng OPENSSL_INCLUDE="${stage}"/packages/include/openssl [ -f "$ZLIB_INCLUDE"/zlib.h ] || fail "You haven't installed the zlib package yet." [ -f "$OPENSSL_INCLUDE"/ssl.h ] || fail "You haven't installed the openssl package yet." -LIBCURL_VERSION_HEADER_DIR="${CURL_SOURCE_DIR}"/include/curl -version=$(perl -ne 's/#define LIBCURL_VERSION "([^"]+)"/$1/ && print' "${LIBCURL_VERSION_HEADER_DIR}/curlver.h" | tr -d '\r' ) +LIBCURL_HEADER_DIR="${CURL_SOURCE_DIR}"/include +LIBCURL_VERSION_HEADER_DIR="$LIBCURL_HEADER_DIR/curl" +version="$(sed -nE 's/#define LIBCURL_VERSION "([^"]+)".*$/\1/p' \ + "$(cygpath -m "${LIBCURL_VERSION_HEADER_DIR}/curlver.h")")" build=${AUTOBUILD_BUILD_ID:=0} -echo "${version}.${build}" > "${stage}/VERSION.txt" +echo "${version}-${build}" > "${stage}/VERSION.txt" # Restore all .sos restore_sos () @@ -96,12 +128,12 @@ get_installable_version () # Split version number on '.'. # Keep up to $2 version-number parts. # Rejoin them on '.' again and print. - # On Windows, change '\r\n' to plain '\n': the '\r' is NOT removed by - # bash, so it becomes part of the string contents, which confuses both - # scripted comparisons and human readers. + # On Windows, use sys.stdout.buffer.write() to avoid appending '\r\n': the + # '\r' is NOT removed by bash, so it becomes part of the string contents, + # which confuses both scripted comparisons and human readers. python -c "from ast import literal_eval -print '.'.join(literal_eval(r'''$pydata''')['version'].split('.')[:${2:-}])" \ - | tr -d '\r' +import sys +sys.stdout.buffer.write('.'.join(literal_eval(r'''$pydata''')['version'].split('.')[:${2:-}]).encode('utf-8'))" set -x } @@ -121,7 +153,9 @@ pushd "$CURL_BUILD_DIR" packages="$(cygpath -m "$stage/packages")" load_vsvars - cmake ../${CURL_SOURCE_DIR} -G"$AUTOBUILD_WIN_CMAKE_GEN" -DCMAKE_C_FLAGS:STRING="$LL_BUILD_RELEASE" \ + cmake "$(cygpath -m "${CURL_SOURCE_DIR}")" \ + -G"$AUTOBUILD_WIN_CMAKE_GEN" -A"$AUTOBUILD_WIN_VSPLATFORM" \ + -DCMAKE_C_FLAGS:STRING="$LL_BUILD_RELEASE" \ -DCMAKE_CXX_FLAGS:STRING="$LL_BUILD_RELEASE" \ -DENABLE_THREADED_RESOLVER:BOOL=ON \ -DCMAKE_USE_OPENSSL:BOOL=TRUE \ @@ -132,7 +166,7 @@ pushd "$CURL_BUILD_DIR" check_damage "$AUTOBUILD_PLATFORM" - build_sln "CURL.sln" "Release|$AUTOBUILD_WIN_VSPLATFORM" "Install" + build_sln "CURL.sln" "Release|$AUTOBUILD_WIN_VSPLATFORM" ## "Install" # conditionally run unit tests if [ "${DISABLE_UNIT_TESTS:-0}" = "0" ]; then @@ -142,18 +176,22 @@ pushd "$CURL_BUILD_DIR" popd fi - # Stage archives - mkdir -p "${stage}/lib/release" - mv "${stage}"/lib/libcurl.lib "${stage}"/lib/release/libcurl.lib + # stage header files + cp -R "$LIBCURL_HEADER_DIR" "${stage}/" + + # Stage archives + mkdir -p "${stage}/lib/release" + mv "lib/Release/libcurl.lib" "${stage}"/lib/release/ # # Stage curl.exe and provide .dll's it needs -# mkdir -p "${stage}"/bin - cp -af "${stage}"/packages/lib/release/*.dll "${stage}"/bin/ - chmod +x-w "${stage}"/bin/*.dll # correct package permissions + curldir="src/Release" +## mkdir -p "${stage}"/bin + cp -af "${stage}"/packages/lib/release/*.dll "$curldir/" + chmod +x-w "$curldir"/*.dll # correct package permissions # Run 'curl' as a sanity check. Capture just the first line, which # should have versions of stuff. - curlout="$("${stage}"/bin/curl.exe --version | tr -d '\r' | head -n 1)" + curlout="$("$curldir/curl.exe" --version | head -n 1)" # With -e in effect, any nonzero rc blows up the script -- # so plain 'expr str : pattern' asserts that str contains pattern. # curl version - should be start of line @@ -163,19 +201,12 @@ pushd "$CURL_BUILD_DIR" # OpenSSL/version expr "$curlout" : ".* OpenSSL/$(escape_dots "$(get_installable_version openssl 3)")" > /dev/null # zlib/version - expr "$curlout" : ".* zlib/$(escape_dots "$(get_installable_version zlib 3)")" > /dev/null - -# # Clean -# pushd lib -# nmake /f Makefile.VC6 clean -# popd -# pushd src -# nmake /f Makefile.VC6 clean -# popd + expr "$curlout" : ".* zlib/$(escape_dots "$(get_installable_version zlib-ng 3)")" > /dev/null ;; darwin*) opts="${TARGET_OPTS:--arch $AUTOBUILD_CONFIGURE_ARCH $LL_BUILD_RELEASE}" + plainopts="$(remove_cxxstd $opts)" mkdir -p "$stage/lib/release" rm -rf Resources/ ../Resources tests/Resources/ @@ -200,7 +231,12 @@ pushd "$CURL_BUILD_DIR" # ln -sf "${stage}"/packages/lib/release/*.dylib tests/Resources/ # LDFLAGS="-L../Resources/ -L\"$stage\"/packages/lib/release" \ - cmake ../${CURL_SOURCE_DIR} -GXcode -DCMAKE_C_FLAGS:STRING="$opts" \ + # -T buildsystem=1 is to work around an error in the upstream + # CMakeLists.txt that doesn't work with the Xcode "new build + # system." Possibly a newer version of curl will fix. + # https://stackoverflow.com/a/65474688 + cmake "${CURL_SOURCE_DIR}" -G Xcode -T buildsystem=1 \ + -DCMAKE_C_FLAGS:STRING="$plainopts" \ -DCMAKE_CXX_FLAGS:STRING="$opts" -D'BUILD_SHARED_LIBS:bool=off' \ -DENABLE_THREADED_RESOLVER:BOOL=ON \ -DCMAKE_USE_OPENSSL:BOOL=TRUE \ @@ -264,6 +300,7 @@ pushd "$CURL_BUILD_DIR" # Default target per --address-size opts="${TARGET_OPTS:--m$AUTOBUILD_ADDRSIZE $LL_BUILD_RELEASE}" + plainopts="$(remove_cxxstd $opts)" # Handle any deliberate platform targeting if [ -z "${TARGET_CPPFLAGS:-}" ]; then @@ -298,8 +335,8 @@ pushd "$CURL_BUILD_DIR" # Release configure and build export LD_LIBRARY_PATH="${stage}"/packages/lib/release:"$saved_path" - cmake ../${CURL_SOURCE_DIR} -G"Unix Makefiles" \ - -DCMAKE_C_FLAGS:STRING="$opts" -DCMAKE_CXX_FLAGS:STRING="$opts" \ + cmake "${CURL_SOURCE_DIR}" -G"Unix Makefiles" \ + -DCMAKE_C_FLAGS:STRING="$plainopts" -DCMAKE_CXX_FLAGS:STRING="$opts" \ -DENABLE_THREADED_RESOLVER:BOOL=ON \ -DCMAKE_USE_OPENSSL:BOOL=TRUE \ -DUSE_NGHTTP2:BOOL=TRUE \ @@ -332,7 +369,7 @@ pushd "$CURL_BUILD_DIR" ;; esac mkdir -p "$stage/LICENSES" - cp ../"${CURL_SOURCE_DIR}"/COPYING "$stage/LICENSES/curl.txt" + cp "${CURL_SOURCE_DIR}"/COPYING "$stage/LICENSES/curl.txt" popd rm -rf "$CURL_BUILD_DIR" diff --git a/curl/CMake/FindZLIB.cmake b/curl/CMake/FindZLIB.cmake index 180798a1..9ec88f55 100644 --- a/curl/CMake/FindZLIB.cmake +++ b/curl/CMake/FindZLIB.cmake @@ -59,7 +59,7 @@ if (IS_DIRECTORY ${PACKAGE_DIR}) PATHS "${PACKAGE_DIR}/include" PATH_SUFFIXES - "zlib" + "zlib-ng" ) if (${ZLIB_INCLUDE_DIRS} STREQUAL "ZLIB_INCLUDE_DIRS-NOTFOUND") diff --git a/curl/CMakeLists.txt b/curl/CMakeLists.txt index 6a51ed39..8f2083c8 100644 --- a/curl/CMakeLists.txt +++ b/curl/CMakeLists.txt @@ -1156,7 +1156,16 @@ function(TRANSFORM_MAKEFILE_INC INPUT_FILE OUTPUT_FILE) endfunction() -add_subdirectory(docs) +find_program(groff groff) +find_program(roffit roffit) +find_program(ps2pdf ps2pdf) +##message(STATUS "groff='${groff}', roffit=${roffit}, ps2pdf=${ps2pdf}") +# Making the docs subdirectory requires all three of the above commands. +if (NOT (${groff} STREQUAL "groff-NOTFOUND" OR + ${roffit} STREQUAL "roffit-NOTFOUND" OR + ${ps2pdf} STREQUAL "ps2pdf-NOTFOUND")) + add_subdirectory(docs) +endif() add_subdirectory(lib) if(BUILD_CURL_EXE) add_subdirectory(src) diff --git a/curl/src/CMakeLists.txt b/curl/src/CMakeLists.txt index e6004cea..c0c48e38 100644 --- a/curl/src/CMakeLists.txt +++ b/curl/src/CMakeLists.txt @@ -1,22 +1,24 @@ set(EXE_NAME curl) +set(tool_hugehelp_path "${CURL_BINARY_DIR}/src/tool_hugehelp.c") + if(USE_MANUAL) # Use the C locale to ensure that only ASCII characters appear in the # embedded text. NROFF and MANOPT are set in the parent CMakeLists.txt add_custom_command( - OUTPUT tool_hugehelp.c - COMMAND ${CMAKE_COMMAND} -E echo "#include \"tool_setup.h\"" > tool_hugehelp.c - COMMAND ${CMAKE_COMMAND} -E echo "#ifndef HAVE_LIBZ" >> tool_hugehelp.c + OUTPUT ${tool_hugehelp_path} + COMMAND ${CMAKE_COMMAND} -E echo "#include \"tool_setup.h\"" > ${tool_hugehelp_path} + COMMAND ${CMAKE_COMMAND} -E echo "#ifndef HAVE_LIBZ" >> ${tool_hugehelp_path} COMMAND env LC_ALL=C "${NROFF}" ${NROFF_MANOPT} "${CURL_BINARY_DIR}/docs/curl.1" | "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl" - "${CURL_SOURCE_DIR}/docs/MANUAL" >> tool_hugehelp.c - COMMAND ${CMAKE_COMMAND} -E echo "#else" >> tool_hugehelp.c + "${CURL_SOURCE_DIR}/docs/MANUAL" >> ${tool_hugehelp_path} + COMMAND ${CMAKE_COMMAND} -E echo "#else" >> ${tool_hugehelp_path} COMMAND env LC_ALL=C "${NROFF}" ${NROFF_MANOPT} "${CURL_BINARY_DIR}/docs/curl.1" | "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mkhelp.pl" -c - "${CURL_SOURCE_DIR}/docs/MANUAL" >> tool_hugehelp.c - COMMAND ${CMAKE_COMMAND} -E echo "#endif /* HAVE_LIBZ */" >> tool_hugehelp.c + "${CURL_SOURCE_DIR}/docs/MANUAL" >> ${tool_hugehelp_path} + COMMAND ${CMAKE_COMMAND} -E echo "#endif /* HAVE_LIBZ */" >> ${tool_hugehelp_path} DEPENDS "${CURL_SOURCE_DIR}/docs/MANUAL" generate-curl.1 @@ -26,16 +28,21 @@ if(USE_MANUAL) VERBATIM) else() add_custom_command( - OUTPUT tool_hugehelp.c - COMMAND ${CMAKE_COMMAND} -E echo "/* built-in manual is disabled, blank function */" > tool_hugehelp.c - COMMAND ${CMAKE_COMMAND} -E echo "#include \"tool_hugehelp.h\"" >> tool_hugehelp.c - COMMAND ${CMAKE_COMMAND} -E echo "void hugehelp(void) {}" >> tool_hugehelp.c + OUTPUT ${tool_hugehelp_path} + COMMAND ${CMAKE_COMMAND} -E echo "/* built-in manual is disabled, blank function */" > ${tool_hugehelp_path} + COMMAND ${CMAKE_COMMAND} -E echo "#include \"tool_hugehelp.h\"" >> ${tool_hugehelp_path} + COMMAND ${CMAKE_COMMAND} -E echo "void hugehelp(void) {}" >> ${tool_hugehelp_path} DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/tool_hugehelp.h" VERBATIM) endif() +# This tool_hugehelp target that depends on generated ${tool_hugehelp_path} +# ensures that when tool_hugehelp is required, the correct add_custom_command +# above will run. +add_custom_target(tool_hugehelp DEPENDS ${tool_hugehelp_path}) + transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") include(${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake) @@ -47,7 +54,11 @@ endif() add_executable( ${EXE_NAME} ${CURL_FILES} - ) +) +# This add_dependencies ensures that ${tool_hugehelp_path} will be generated +# before we try to build the executable. Otherwise CMake tries it in the other +# order, producing a "no such source file" error. +add_dependencies(${EXE_NAME} tool_hugehelp) source_group("curlX source files" FILES ${CURLX_CFILES}) source_group("curl source files" FILES ${CURL_CFILES}) diff --git a/curl/tests/server/util.c b/curl/tests/server/util.c index a2340f46..1cbeae3c 100644 --- a/curl/tests/server/util.c +++ b/curl/tests/server/util.c @@ -148,8 +148,8 @@ void win32_perror(const char *msg) char buf[512]; DWORD err = SOCKERRNO; - if(!FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, - LANG_NEUTRAL, buf, sizeof(buf), NULL)) + if(!FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, + LANG_NEUTRAL, buf, sizeof(buf), NULL)) snprintf(buf, sizeof(buf), "Unknown error %lu (%#lx)", err, err); if(msg) fprintf(stderr, "%s: ", msg);