curl/tests/server
Viktor Szakats a72b479dec
build: fix MSVC UWP builds
The MSVC UWP job in CI did not actually enable UWP. Fix this and
the fallouts discovered after enabling it.

- GHA/windows: make sure to enable UWP in MSVC vcpkg UWP job.
  Use the CMake options and C flags already used for mingw-w64, but use
  `WINAPI_FAMILY_PC_APP` instead of the deprecated `WINAPI_FAMILY_APP`.
  (The former is not supported by mingw-w64, so leave it there as-is.)
  Follow-up to cb22cfca69 #14077

- GHA/windows: by default the MSVC UWP job became 2x-3x slower than
  others after actually enabling UWP. Most of it is caused by
  CMake/MSBuild automatically building full APPX containers for each
  `.exe` target. This includes 21 CMake feature detections. Each
  detection app is built into a 15MB APPX project, with code signing,
  logos, etc. Example:
    https://github.com/curl/curl/actions/runs/12056968170/job/33620610958
  Disable this overhead for curl build targets via custom
  `CMAKE_VS_GLOBALS` options. I've found no way to apply them to feature
  detection targets, so those remain slow.

- cmake: automatically enable Unicode for UWP builds. It's required.
  Also stop enabling it manually in the existing CI job.

- tests: fix `getpid()` use for Windows UWP:
  ```
  tests\server\util.c(281,21): warning C4013: 'getpid' undefined; assuming extern returning int
  ```
  Ref: https://github.com/curl/curl/actions/runs/12061215311/job/33632904249#step:11:38

- src/tool_doswin: disable `GetLoadedModulePaths()` for UWP.
  mingw-w64 UWP was okay with this, but MS SDK headers are not.
  This makes `--dump-module-paths` return empty for UWP builds.
  ```
  src\tool_doswin.c(620,3): error C2065: 'MODULEENTRY32': undeclared identifier
  src\tool_doswin.c(626,11): warning C4013: 'CreateToolhelp32Snapshot' undefined; assuming extern returning int
  src\tool_doswin.c(626,36): error C2065: 'TH32CS_SNAPMODULE': undeclared identifier
  src\tool_doswin.c(632,7): warning C4013: 'Module32First' undefined; assuming extern returning int
  ```
  Ref: https://github.com/curl/curl/actions/runs/12055081933/job/33614629930#step:9:35

- examples: fix `websocket.c` to include `winsock2.h` before `windows.h`
  to make it build with MSVC UWP:
  ```
  include\curl\curl.h(143,16): error C2061: syntax error: identifier 'curl_socket_t'
  include\curl\curl.h(143,16): error C2059: syntax error: ';'
  include\curl\curl.h(417,52): error C2146: syntax error: missing ')' before identifier 'curlfd'
  include\curl\curl.h(417,38): error C2081: 'curl_socket_t': name in formal parameter list illegal
  ```
  Ref: https://github.com/curl/curl/actions/runs/12055317910/job/33615644427#step:14:126

- GHA/windows: silence linker warning with MSVC UWP builds:
  ```
  LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF' specification
  ```
  Ref: https://github.com/curl/curl/actions/runs/12055696808/job/33616629610#step:11:38

- GHA/windows: set `/INCREMENTAL:NO` for all MSVC jobs to improve
  performance a little.

- cmake: show `UWP` platform flag.

Ref: #15652
Closes #15657
2024-11-28 14:24:03 +01:00
..
.checksrc tests/server/util.c: remove use of strncpy 2024-10-10 07:47:01 +02:00
.gitignore NTLM_WB: delete remains in tests, docs updates 2024-09-10 14:13:36 +02:00
base64.pl copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
CMakeLists.txt cmake: replace CURL_*_DIR with {PROJECT,CMAKE_CURRENT}_*_DIR 2024-10-22 19:13:08 +02:00
disabled.c curl: add options for safe/no CA bundle search (Windows) 2024-09-22 18:17:25 +02:00
getpart.c server/getpart: delete unused code 2024-09-09 16:57:36 +02:00
getpart.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
Makefile.am tests/server/util.c: remove use of strncpy 2024-10-10 07:47:01 +02:00
Makefile.inc NTLM_WB: delete remains in tests, docs updates 2024-09-10 14:13:36 +02:00
mqttd.c server/mqttd: fix two memory leaks 2024-10-14 12:47:21 +02:00
resolve.c cmake: allow building tests in unity mode 2024-09-19 21:32:58 +02:00
rtspd.c build: fix MSVC UWP builds 2024-11-28 14:24:03 +01:00
server_setup.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
server_sockaddr.h build: prefer USE_IPV6 macro internally (was: ENABLE_IPV6) 2024-04-13 08:33:26 +00:00
sockfilt.c warnless: remove curlx_sktosi and curlx_sitosk 2024-10-05 00:28:06 +02:00
socksd.c lib/src: white space edits to comply better with code style 2024-09-19 14:59:12 +02:00
sws.c build: fix MSVC UWP builds 2024-11-28 14:24:03 +01:00
testpart.c lib/src: white space edits to comply better with code style 2024-09-19 14:59:12 +02:00
tftp.h tests: tidy up types in server code 2024-05-13 11:16:26 +02:00
tftpd.c build: fix MSVC UWP builds 2024-11-28 14:24:03 +01:00
util.c build: fix MSVC UWP builds 2024-11-28 14:24:03 +01:00
util.h build: enable missing OpenSSF-recommended warnings, with fixes 2023-12-16 13:12:37 +00:00