首页 > 解决方案 > 使用 CMAKE (macOS Catalina) 构建项目时未通过字节顺序测试

问题描述

我正在开发一个用 C++ 编写的项目,因此我们使用 CMAKE 构建它。我在 CentOS 机器上工作,一切都很好。但是,现在我已经切换到 macOS(我有最新的 Catalina 更新),首先我从 github 克隆了 repo,安装了 cmake 并尝试构建它,但由于ENDIANESS TEST项目没有完成构建而失败。是我正在尝试处理的回购协议。我还使用了一些额外的标志,但这不应该是问题。任何想法如何解决这一问题?

这是我用于尝试构建的命令:

/usr/local/bin/cmake -D ZLIB_INCLUDE_DIR=/Users/basavyr/Downloads/zlib-1.2.11/ -D OPENSSL_INCLUDE_DIR=/usr/local/Cellar/openssl@1.1/1.1.1d/include/ -D OPENSSL_SSL_LIBRARY=/usr/local/Cellar/openssl@1.1/1.1.1d/lib/libssl.dylib -D OPENSSL/CRYPTO_LIBRARY=/usr/local/Cellar/openssl@1.1/1.1.1d/lib/libcrypto.1.1.dylib -D CMAKE_INSTALL_PREFIX=../tarball/xrootd ../

这是我得到的错误(忽略其他错误,那些显然不影响失败):

CMake Deprecation Warning at CMakeLists.txt:13 (cmake_policy):
  The OLD behavior for policy CMP0054 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- Could NOT find systemd (missing: SYSTEMD_INCLUDE_DIRS SYSTEMD_LIBRARIES) 
-- Could NOT find Macaroons (missing: MACAROONS_INCLUDES MACAROONS_LIB) 
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) 
[I] Determining version from git
-- crc32c submodule update
-- Check if the system is big endian
-- Searching 16 bit integer
CMake Error at /usr/local/Cellar/cmake/3.16.2/share/cmake/Modules/TestBigEndian.cmake:50 (message):
  no suitable type found
Call Stack (most recent call first):
  external/crc32c/CMakeLists.txt:67 (test_big_endian)


-- Configuring incomplete, errors occurred!
See also "/Users/basavyr/Pipeline/DevWorkspace/Github/xrootd/build/CMakeFiles/CMakeOutput.log".
See also "/Users/basavyr/Pipeline/DevWorkspace/Github/xrootd/build/CMakeFiles/CMakeError.log".

我试图搜索这两个文件,但老实说我找不到任何有用的东西。我也尝试在网上搜索这个问题,但没有任何成功。

标签: c++cmake

解决方案


推荐阅读