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

debug 和 release 模式的 find_packages 结果不一致。 #832

Closed
imkerberos opened this issue Jun 9, 2020 · 2 comments
Closed

debug 和 release 模式的 find_packages 结果不一致。 #832

imkerberos opened this issue Jun 9, 2020 · 2 comments
Labels
Milestone

Comments

@imkerberos
Copy link

描述问题

环境:

  • MacOSX 10.15.4
  • Xcode 11.4.1
  • xmake 2.3.4
  • brew: libxml2, ffmpeg 已经安装

工程文件 xmake.lua

add_rules("mode.debug", "mode.release")

target("davc")
	set_kind("binary")
	add_files("src/*.c")

	on_load(function(target)
		local packages= find_packages("xml2", "zlib", "ffmpeg")
		print(packages)
		target:add(packages)
	end)

使用指令 rm -rf .xmake build && xmake f -m debug && rm -rf .xmake build && xmake f -m release 打印找到的系统中的 packages:
debug 模式下:

checking for the architecture ... x86_64
checking for the Xcode directory ... /Applications/Xcode.app
checking for the SDK version of Xcode ... 10.15
checking for the Codesign Identity of Xcode ... no
{
  {
    links = {
      "z"
    },
    linkdirs = {
      "/usr/lib"
    }
  }
}

release 模式下

checking for the architecture ... x86_64
checking for the Xcode directory ... /Applications/Xcode.app
checking for the SDK version of Xcode ... 10.15
checking for the Codesign Identity of Xcode ... no
{
  {
    links = {
      "xml2"
    },
    linkdirs = {
      "/usr/lib"
    }
  },
  {
    links = {
      "z"
    },
    linkdirs = {
      "/usr/lib"
    },
    version = "1.2.11"
  },
  {
    links = {
      "avutil",
      "avfilter",
      "avcodec",
      "postproc",
      "avresample",
      "avformat",
      "avdevice",
      "swresample",
      "swscale",
      "swresample.3.5.100",
      "avfilter.7.57.100",
      "postproc.55.5.100",
      "avcodec.58.54.100",
      "swscale.5.5.100",
      "avresample.4.0.0",
      "avutil.56.31.100",
      "avdevice.58.8.100",
      "avformat.58.29.100"
    },
    linkdirs = {
      "/usr/local/Cellar/ffmpeg/4.2.3_1/lib"
    },
    includedirs = "/usr/local/Cellar/ffmpeg/4.2.3_1/include"
  }
}

期待的结果

debug 模式和 release 模式输出的 packages 结果一致, 都能够找到 xml2, ffmpeg,zlib.

错误信息

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

相关环境

  • MacOSX 10.15.4
  • Xcode 11.4.1
  • xmake 2.3.4
  • brew: libxml2, ffmpeg 已经安装

其他信息

xmake.lua

add_rules("mode.debug", "mode.release")

target("davc")
	set_kind("binary")
	add_files("src/*.c")

	on_load(function(target)
		local packages= find_packages("xml2", "zlib", "ffmpeg")
		print(packages)
		target:add(packages)
	end)
@waruqi
Copy link
Member

waruqi commented Jun 9, 2020

我修复了你再试试,xmake update -s dev

@waruqi waruqi added this to the v2.3.5 milestone Jun 9, 2020
@waruqi waruqi added the bug label Jun 9, 2020
@imkerberos
Copy link
Author

It works!!! thx.

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