Skip to content

十分简单的xmake.lua 直接用xmake使用boost install failed! #9372

@introspection3

Description

@introspection3

Xmake 版本

xmake v3.0.7+

操作系统版本和架构

windows11

描述问题

add_rules("mode.debug", "mode.release")
set_languages("c++20")
add_requires("spdlog")
-- folly 需要 fiber 支持 
add_requires("boost", {configs = {fiber = true}})
target("hello")
    set_kind("binary")
    add_files("src/*.cpp")
     -- 绑定依赖到目标
    add_packages("spdlog", "fmt", "boost")
 

PS D:\prjs\cpp\hello> xmake f -c
checking for platform ... windows
checking for architecture ... x64
checking for Microsoft C/C++ Compiler (x64) ... ok
checking for Microsoft Visual Studio (x64) version ... 2022
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
-> boost 1.90.0 [runtimes:"MD", fiber:y, license:BSL-1.0]
please input: y (y/n/m)

=> download https://github.com/boostorg/boost/releases/download/boost-1.90.0/boost-1.90.0-cmake.tar.gz .. ok
=> install boost 1.90.0 .. failed

CMake Error in C:/Users/qsy_/AppData/Local/.xmake/cache/packages/2602/b/boost/1.-- Configuring incomplete, errors occurred!
cratch/TryCompile-y4p61n/CMakeLists.txt:
LINKER_TYPE 'MSVC' is unknown or not supported by this toolchain.
CMake Error at D:/Program Files/CMake/share/cmake-4.2/Modules/CMakeDetermineCompilerABI.cmake:83 (try_compile):
Failed to generate test project build system.
Call Stack (most recent call first):
D:/Program Files/CMake/share/cmake-4.2/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)
CMakeLists.txt:13 (project)
if you want to get more verbose errors, please see:
-> C:\Users\qsy_\AppData\Local.xmake\cache\packages\2602\b\boost\1.90.0\installdir.failed\logs\install.txt
error: install failed!
warning: If cmake build failure, set package config cmake = false fallback to b2 for the build

期待的结果

可以编译

工程配置

add_rules("mode.debug", "mode.release")
set_languages("c++20")
add_requires("spdlog")
-- folly 需要 fiber 支持 
add_requires("boost", {configs = {fiber = true}})
target("hello")
    set_kind("binary")
    add_files("src/*.cpp")
     -- 绑定依赖到目标
    add_packages("spdlog", "fmt", "boost")
 

附加信息和错误日志

PS D:\prjs\cpp\hello> xmake f -c
checking for platform ... windows
checking for architecture ... x64
checking for Microsoft C/C++ Compiler (x64) ... ok
checking for Microsoft Visual Studio (x64) version ... 2022
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> boost 1.90.0 [runtimes:"MD", fiber:y, license:BSL-1.0]
please input: y (y/n/m)
y
  => download https://github.com/boostorg/boost/releases/download/boost-1.90.0/boost-1.90.0-cmake.tar.gz .. failed
  => download https://github.com/boostorg/boost/releases/download/boost-1.90.0/boost-1.90.0.tar.gz .. failed
  => download https://github.com/boostorg/boost/releases/download/boost-1.90.0/boost-1.90.0-b2-nodocs.tar.gz .. failed
  => download https://github.com/xmake-mirror/boost/releases/download/boost-1.90.0/boost_1_90_0.tar.bz2 .. failed

we can also download these packages manually:
  - https://github.com/boostorg/boost/releases/download/boost-1.90.0/boost-1.90.0-cmake.tar.gz
  - https://github.com/boostorg/boost/releases/download/boost-1.90.0/boost-1.90.0.tar.gz
  - https://github.com/boostorg/boost/releases/download/boost-1.90.0/boost-1.90.0-b2-nodocs.tar.gz       
  - https://github.com/xmake-mirror/boost/releases/download/boost-1.90.0/boost_1_90_0.tar.bz2
to the local search directories:
  - boost-1.90.0.tar.gz, boost-1.90.0-b2-nodocs.tar.gz, boost-1.90.0.tar.bz2, boost-1.90.0-cmake.tar.gz, boost_1_90_0.tar.bz2
and we can run `xmake g --pkg_searchdirs=/xxx` to set the search directories.
error: curl: (22) The requested URL returned error: 404

warning: If cmake build failure, set package config cmake = false fallback to b2 for the build

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions