2 #***************************************************************************
4 # Project ___| | | | _ \| |
6 # | (__| |_| | _ <| |___
7 # \___|\___/|_| \_\_____|
9 # Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
11 # This software is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at https://curl.se/docs/copyright.html.
15 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
16 # copies of the Software, and permit persons to whom the Software is
17 # furnished to do so, under the terms of the COPYING file.
19 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 # KIND, either express or implied.
22 # SPDX-License-Identifier: curl
24 ###########################################################################
26 # shellcheck disable=SC3040,SC2039
27 set -eux; [ -n "${BASH:-}${ZSH_NAME:-}" ] && set -o pipefail
31 if [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2022' ]; then
32 openssl_root_win
='C:/OpenSSL-v30-Win64'
34 openssl_root_win
='C:/OpenSSL-v111-Win64'
36 openssl_root
="$(cygpath -u "${openssl_root_win}")"
38 if [ "${BUILD_SYSTEM}" = 'CMake' ]; then
40 [[ "${TARGET:-}" = *'ARM64'* ]] && SKIP_RUN
='ARM64 architecture'
41 [ "${OPENSSL}" = 'ON' ] && options
+=" -DOPENSSL_ROOT_DIR=${openssl_root_win}"
42 [ "${OPENSSL}" = 'ON' ] && options
+=" -DOPENSSL_ROOT_DIR=${openssl_root_win}"
43 [ "${PRJ_CFG}" = 'Debug' ] && options
+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG='
44 [ "${PRJ_CFG}" = 'Release' ] && options
+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE='
45 [[ "${PRJ_GEN}" = *'Visual Studio'* ]] && options
+=' -DCMAKE_VS_GLOBALS=TrackFileAccess=false'
46 # Fails to run without this run due to missing MSVCR90.dll
47 [ "${PRJ_GEN}" = 'Visual Studio 9 2008' ] && options
+=' -DCURL_STATIC_CRT=ON'
48 # shellcheck disable=SC2086
49 cmake
-B _bld
"-G${PRJ_GEN}" ${TARGET:-} ${options} \
50 "-DCURL_USE_OPENSSL=${OPENSSL}" \
51 "-DCURL_USE_SCHANNEL=${SCHANNEL}" \
52 "-DHTTP_ONLY=${HTTP_ONLY}" \
53 "-DBUILD_SHARED_LIBS=${SHARED}" \
54 "-DBUILD_TESTING=${TESTING}" \
55 "-DENABLE_WEBSOCKETS=${WEBSOCKETS:-}" \
56 "-DCMAKE_UNITY_BUILD=${UNITY}" \
58 "-DENABLE_DEBUG=${DEBUG}" \
59 "-DENABLE_UNICODE=${ENABLE_UNICODE}" \
60 '-DCMAKE_INSTALL_PREFIX=C:/CURL' \
61 "-DCMAKE_BUILD_TYPE=${PRJ_CFG}"
62 # shellcheck disable=SC2086
63 cmake --build _bld --config "${PRJ_CFG}" --parallel 2 --clean-first -- ${BUILD_OPT:-}
64 if [ "${SHARED}" = 'ON' ]; then
65 cp -f -p _bld/lib/*.dll _bld/src/
67 if [ "${OPENSSL}" = 'ON' ]; then
68 cp -f -p "${openssl_root}"/*.dll _bld/src/
70 curl='_bld/src/curl.exe'
71 elif [ "${BUILD_SYSTEM}" = 'VisualStudioSolution' ]; then
74 ./generate.bat "${VC_VERSION}"
75 msbuild.exe -maxcpucount "-property:Configuration
=${PRJ_CFG}" "Windows
/${VC_VERSION}/curl-all.sln
"
77 curl="build
/Win32
/${VC_VERSION}/${PRJ_CFG}/curld.exe
"
78 elif [ "${BUILD_SYSTEM}" = 'winbuild_vs2015' ]; then
82 cat << EOF > _make.bat
83 call "C
:/Program Files
/Microsoft SDKs
/Windows
/v7.1
/Bin
/SetEnv.cmd
" /x64
84 call "C
:/Program Files
(x86
)/Microsoft Visual Studio
14.0/VC
/vcvarsall.bat
" x86_amd64
85 nmake -f Makefile.vc mode=dll VC=14 "SSL_PATH
=${openssl_root_win}" WITH_SSL=dll MACHINE=x64 DEBUG=${DEBUG} ENABLE_UNICODE=${ENABLE_UNICODE}
90 curl
="builds/libcurl-vc14-x64-${PATHPART}-dll-ssl-dll-ipv6-sspi/bin/curl.exe"
91 elif [ "${BUILD_SYSTEM}" = 'winbuild_vs2017' ]; then
95 cat << EOF > _make.bat
96 call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvars64.bat"
97 nmake -f Makefile.vc mode=dll VC=14.10 "SSL_PATH=${openssl_root_win}" WITH_SSL=dll MACHINE=x64 DEBUG=${DEBUG} ENABLE_UNICODE=${ENABLE_UNICODE}
102 curl
="builds/libcurl-vc14.10-x64-${PATHPART}-dll-ssl-dll-ipv6-sspi/bin/curl.exe"
103 elif [ "${BUILD_SYSTEM}" = 'autotools' ]; then
108 # shellcheck disable=SC2086
109 ..
/configure
${CONFIG_ARGS:-}
111 make -j2 V
=1 examples
115 curl
='_bld/src/curl.exe'
118 find .
-name '*.exe' -o -name '*.dll'
119 if [ -z "${SKIP_RUN:-}" ]; then
122 echo "Skip running curl.exe. Reason: ${SKIP_RUN}"
126 for log
in CMakeFiles
/CMakeConfigureLog.yaml CMakeFiles
/CMakeOutput.log CMakeFiles
/CMakeError.log
; do
127 [ -r "_bld/${log}" ] && cat "_bld/${log}"
131 if [ "${TESTING}" = 'ON' ] && [ "${BUILD_SYSTEM}" = 'CMake' ]; then
132 cmake
--build _bld
--config "${PRJ_CFG}" --parallel 2 --target testdeps
137 if [ "${TESTING}" = 'ON' ]; then
139 if [ -x "$(cygpath -u "${WINDIR}/System32
/curl.exe
")" ]; then
140 TFLAGS
+=" -ac $(cygpath -u "${WINDIR}/System32
/curl.exe
")"
141 elif [ -x "$(cygpath -u "C
:/msys64
/usr
/bin
/curl.exe
")" ]; then
142 TFLAGS
+=" -ac $(cygpath -u "C
:/msys64
/usr
/bin
/curl.exe
")"
144 TFLAGS
+=" ${DISABLED_TESTS:-}"
145 if [ "${BUILD_SYSTEM}" = 'CMake' ]; then
146 ls _bld
/lib
/*.dll
>/dev
/null
2>&1 && cp -f -p _bld
/lib
/*.dll _bld
/tests
/libtest
/
147 cmake
--build _bld
--config "${PRJ_CFG}" --target test-ci
148 elif [ "${BUILD_SYSTEM}" = 'autotools' ]; then
155 TFLAGS
="-a -p !flaky -r -rm ${TFLAGS}"