Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xmake f --menu 配置和生成的不一致 #1004

Closed
zwxf opened this issue Oct 23, 2020 · 3 comments
Closed

xmake f --menu 配置和生成的不一致 #1004

zwxf opened this issue Oct 23, 2020 · 3 comments
Labels
Milestone

Comments

@zwxf
Copy link

zwxf commented Oct 23, 2020

描述问题

使用xmake f --menu配置后,保存配置,无法正确生成config.h配置信息,总是和menu配置的值相反,看着像是使用了旧的配置生成config.h
环境如下:
xmake.lua中配置了如下

option("have_at")
    set_category("adcore")

    set_description("Add AT to core lib")
    set_showmenu(true)
    set_default(true)
    set_configvar("CONFIG_HAVE_AT", 1)
option_end()

config.h.in设置如下:

#ifndef _ADLIB_CONFIG_H_
#define _ADLIB_CONFIG_H_

${define CONFIG_PLATFORM_TYPE}
${define CONFIG_HAVE_AT}

#endif  /* _ADLIB_CONFIG_H_ */

targe中配置如下:

target("ad-core")
    set_kind("static")
    add_options("have_at")

在使用配置have_at为true下,xmake f -vD --menu生成的log如下:

checking for gcc ... /usr/bin/gcc
generating /mnt/d/Tbox/adlib/config.h.in to build/config.h ..
  > replace CONFIG_PLATFORM_TYPE -> /* #undef CONFIG_PLATFORM_TYPE */
  > replace CONFIG_HAVE_AT -> /* #undef CONFIG_HAVE_AT */
generating /mnt/d/Tbox/adlib/config.h.in ... ok
configure
{
    kind = static
    mode = release
    buildir = build
    ndk_stdcxx = true
    plat = linux
    menu = true
    platform_type = linux
    host = linux
    arch = x86_64
    ccache = false
    have_at = true
    test_define = true
}

在使用配置have_at为false下,xmake f -vD --menu生成的log如下:

checking for gcc ... /usr/bin/gcc
generating /mnt/d/Tbox/adlib/config.h.in to build/config.h ..
  > replace CONFIG_PLATFORM_TYPE -> /* #undef CONFIG_PLATFORM_TYPE */
  > replace CONFIG_HAVE_AT -> #define CONFIG_HAVE_AT 1
generating /mnt/d/Tbox/adlib/config.h.in ... ok
configure
{
    host = linux
    have_at = false
    test_define = true
    plat = linux
    ccache = false
    platform_type = linux
    ndk_stdcxx = true
    kind = static
    arch = x86_64
    mode = release
    menu = true
    buildir = build
}

期待的结果

配置和生成的config.h的信息相同

错误信息

如上。

如果是xmake相关编译问题,请加上-vD参数运行,并给出详细编译输出信息。
如上。

相关环境

host:WSL1
xmake配置:xmake f --plat=linux

  • xmake版本:xmake v2.3.8+202010211626
  • xmake运行平台:Linux zewil 4.4.0-19041-Microsoft Improve vsxmake #488-Microsoft Mon Sep 01 13:43:00 PST 2020 x86_64 x86_64 x86_64 GNU/Linux
  • xmake目标平台:Linux zewil 4.4.0-19041-Microsoft Improve vsxmake #488-Microsoft Mon Sep 01 13:43:00 PST 2020 x86_64 x86_64 x86_64 GNU/Linux

其他信息

请提供其他附加信息帮助我们诊断问题(比如截图,xmake.lua或者可复现的demo),以及你遇到的问题的一些背景信息。

@waruqi
Copy link
Member

waruqi commented Oct 23, 2020

你先临时追加下 -c 强制触发 configs检测生成好了,配置结果会同步过去, xmake f -c --menu -vD

后两天我会详细排查和改进下。

@waruqi waruqi added the bug label Oct 23, 2020
@waruqi waruqi added this to the v2.3.9 milestone Oct 23, 2020
@waruqi
Copy link
Member

waruqi commented Oct 26, 2020

我修复了,你可以更新的dev版本试试,xmake update -s dev

@zwxf
Copy link
Author

zwxf commented Oct 26, 2020

可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants