transmission icon indicating copy to clipboard operation
transmission copied to clipboard

build: Use CXX symbol checking to verify system libutp

Open bheesham opened this issue 2 years ago • 3 comments

Configuring yielded:

  Could NOT find UTP (missing: UTP_LIBRARY UTP_INCLUDE_DIR)
Call Stack (most recent call first):
  /very/long/path/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindUTP.cmake:74 (find_package_handle_standard_args)
  cmake/TrMacros.cmake:136 (find_package)
  CMakeLists.txt:503 (tr_add_external_auto_library)

-- Configuring incomplete, errors occurred!
See also "/home/user/dev/torrents/transmission/build/CMakeFiles/CMakeOutput.log".
See also "/home/user/dev/torrents/transmission/build/CMakeFiles/CMakeError.log".

The error logs included this bit:

/very/long/path/bin/ld: /very/long/path/lib/libutp.a(utp_internal.cpp.o): in function `UTP_FreeAll(UTPSocketHT*)':
(.text+0xc15): undefined reference to `operator delete(void*)'

After changing the check method to use check_cxx_symbol_exists instead, configuring yielded:

-- Found UTP: /very/long/path/lib/libutp.a

Closes https://github.com/transmission/transmission/issues/4910

bheesham avatar Feb 16 '23 04:02 bheesham

Why is this a draft? I agree that checking symbols in a static library will require C++ compiler, while for checking them in a shared library C compiler is enough. LGTM.

mikedld avatar Feb 17 '23 22:02 mikedld

Why is this a draft?

@bheesham ^ ping

ckerr avatar Feb 18 '23 17:02 ckerr

I marked it as a draft because I wasn't sure about https://github.com/transmission/transmission/issues/4910. Though, this gives a definitive answer.

I've unmarked it as a draft. Thanks for the reviews, @mikedld and @ckerr.

bheesham avatar Feb 18 '23 17:02 bheesham