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

这种情况下增量编译不工作 #1154

Closed
qyangdu opened this issue Dec 23, 2020 · 6 comments
Closed

这种情况下增量编译不工作 #1154

qyangdu opened this issue Dec 23, 2020 · 6 comments

Comments

@qyangdu
Copy link

qyangdu commented Dec 23, 2020

Describe the bug

source files:

// ../common/test1.hpp 
#include <iostream>

void f()
{
  std::cout << "f()" << std::endl;
}

// test1.cpp 
#include "common/test1.hpp"

int main(int argc, char** argv)
{
  f();
  return 0;
}
-- xmake.lua
-- global
add_rules('mode.debug', 'mode.release')

set_version('0.1.0')

set_kind('binary')
add_includedirs('..')
set_warnings('all')
set_languages('cxx20')
target('test1')
add_files('test1.cpp')
target_end()

Expected behavior

incremental compilation should work on header updated.

Error output

N/A

If it is a xmake related compilation problem, please add the -v -D parameter and give the detailed compilation output information.

xmake -j2 -v -D
[100%]: build ok!

Related Environment

Please provide compiling and running environment information:

Additional context

N/A

@waruqi
Copy link
Member

waruqi commented Dec 23, 2020

用你的 case 测了下,linux/macos上 这个版本 都没有复现你说的问题,一切正常

@qyangdu
Copy link
Author

qyangdu commented Dec 23, 2020

编译是通过的,第一次编译完成,然后修改header file,再编译不会触发重新编译.
要保证使用的同样的目录结构

@waruqi
Copy link
Member

waruqi commented Dec 23, 2020

编译是通过的,第一次编译完成,然后修改header file,再编译不会触发重新编译.
要保证使用的同样的目录结构

我刚测试的就是 增量编译,一切正常,test1.hpp 改动,在我这会触发二次编译,完全一样的 demo (命名和结构都一样) ,linux/macos都ok

@qyangdu
Copy link
Author

qyangdu commented Dec 23, 2020

image
你看一下这个截图, 第二次xmake没有重新编译.
如果把header文件从common里面拿出来放在同一目录下面没有这个问题。

@waruqi
Copy link
Member

waruqi commented Dec 23, 2020

应该可以了,你更新到 dev 分支再试试。xmake update -s dev

@waruqi waruqi added this to the v2.5.1 milestone Dec 23, 2020
@qyangdu
Copy link
Author

qyangdu commented Dec 23, 2020

谢谢,工作了。

@waruqi waruqi closed this as completed Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants