• 请不要在回答技术问题时复制粘贴 AI 生成的内容
georgetso
V2EX  ›  程序员

xmake 用起来真是舒服

  •  
  •   georgetso · Oct 30, 2018 · 2031 views
    This topic created in 2769 days ago, the information mentioned may be changed or developed.
    @waruqi
    win+vscode 用 wsl 的 clang 编译 cpp 项目, 根本不用写 makefile, 很舒服
    好项目!
    lniwn
        1
    lniwn  
       Oct 30, 2018
    我也觉得 xmake 很棒,只是不知为何人气没有想象的高。
    waruqi
        2
    waruqi  
       Oct 30, 2018 via Android
    额,还是头一次看到关于 xmake 的主题,受宠若惊哈。。多谢支持。
    waruqi
        3
    waruqi  
       Oct 30, 2018 via Android
    @lniwn 太冷门了哦。。没多少人关注。。
    sagaxu
        4
    sagaxu  
       Oct 30, 2018 via Android
    @lniwn 大家都习惯 cmake 了,轮子又多又圆
    georgetso
        5
    georgetso  
    OP
       Oct 31, 2018
    @waruqi 请问这个问题应该怎么配置 xmake.lua ? 我加了 add_cxflags("-std=c++11") 但是无效

    error: This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
    #error This file requires compiler and library support \
    waruqi
        6
    waruqi  
       Oct 31, 2018 via Android
    @georgetso 你设置 set_languages("c++11") 试试

    https://xmake.io/#/zh/manual?id=targetset_languages

    你的设置应该也是可以的,或者执行下 xmake -v 编译看下详细的编译选项,确认下 有没有设置成功
    georgetso
        7
    georgetso  
    OP
       Oct 31, 2018
    @waruqi
    这是 -v 出现的内容:
    ccache clang -c -fvisibility=hidden -O3 -m64 -I/usr/local/include -I/usr/include -Qunused-arguments -o build/.objs/redis/linux/x86_64/release/./connector.cc.o connector.cc

    我指定了 -std=c++17, 但是没有在上面的内容中出现.
    具体来说是编译这个项目出现的问题: https://github.com/danielshaving/redis-cpp17
    waruqi
        8
    waruqi  
       Oct 31, 2018
    @georgetso 我试了下,可以啊,ccache xcrun -sdk macosx clang -c -fvisibility=hidden -O3 -std=c++17 -arch x86_64 -fpascal-strings -fmessage-length=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -Qunused-arguments -o build/.objs/redis/macosx/x86_64/release/./connector.cc.o connector.cc

    下面两种设置,我都试了 ok 的。。

    set_languages("c++17")

    或者

    add_cxflags("-std=c++17")

    你要么到 github 提个 issues 吧,这边讨论不方便维护。
    waruqi
        9
    waruqi  
       Oct 31, 2018
    或者你贴下 你的 xmake.lua 内容
    georgetso
        10
    georgetso  
    OP
       Oct 31, 2018
    @waruqi
    just did, please see
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2731 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 05:05 · PVG 13:05 · LAX 22:05 · JFK 01:05
    ♥ Do have faith in what you're doing.