xmake-repo icon indicating copy to clipboard operation
xmake-repo copied to clipboard

spdlog android 编译报错

Open guijiyang opened this issue 11 months ago • 12 comments

Xmake 版本

2.8.6

操作系统版本和架构

windows10

描述问题

spdlog 编译的时候使用fmt库,add_requires("spdlog v1.13.0", { configs = { header_only = false, fmt_external = true } }) 但是自带的cmake config 的时候会出现找不到fmt config 信息:

编译windows版本的时候就不会有这个问题,fmt 安装包路径的配置信息是不是要传递给spdlog

期待的结果

spdlog使用fmt的情况下编译通过

工程配置

add_requires("spdlog v1.13.0", { configs = { header_only = false, fmt_external = true } })

附加信息和错误日志

checking for cmake ... D:\Program Files\CMake\bin\cmake
D:\Program Files\CMake\bin\cmake -DSPDLOG_BUILD_TESTS=OFF -DSPDLOG_BUILD_EXAMPLE=OFF -DSPDLOG_BUILD_SHARED=OFF -DSPDLOG_USE_STD_FORMAT=OFF -DSPDLOG_FMT_EXTERNAL=ON -DSPDLOG_FMT_EXTERNAL_HO=OFF -DSPDLOG_NO_EXCEPTIONS=OFF -DSPDLOG_WCHAR_SUPPORT=OFF -DCMAKE_INSTALL_PREFIX=F:\packages\s\spdlog\v1.13.0\8ed1ed185b0143e89804de2862dc3c49 -DCMAKE_INSTALL_LIBDIR:PATH=lib -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=D:\android-ndk-r26b\build\cmake\android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-26 -DANDROID_NATIVE_API_LEVEL=26 -DCMAKE_MAKE_PROGRAM=D:\android-ndk-r26b\prebuilt\windows-x86_64\bin\make.exe -DCMAKE_POSITION_INDEPENDENT_CODE=ON F:\xmake_global\.xmake\cache\packages\2403\s\spdlog\v1.13.0\source
-- The CXX compiler identification is Clang 17.0.2
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/android-ndk-r26b/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Build spdlog: 1.13.0
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Build type: Release
CMake Error at CMakeLists.txt:211 (find_package):
  Could not find a package configuration file provided by "fmt" with any of
  the following names:

    fmtConfig.cmake
    fmt-config.cmake

  Add the installation prefix of "fmt" to CMAKE_PREFIX_PATH or set "fmt_DIR"
  to a directory containing one of the above files.  If "fmt" provides a
  separate development package or SDK, be sure it has been installed.


-- Configuring incomplete, errors occurred!

guijiyang avatar Mar 13 '24 04:03 guijiyang