xmake.lua 377 B

123456789101112131415
  1. add_rules("mode.debug", "mode.release")
  2. target("test")
  3. set_kind("binary")
  4. add_files("$(builddir)/autogen.cpp", {always_added = true})
  5. before_build(function (target)
  6. io.writefile("$(builddir)/autogen.cpp", [[
  7. #include <iostream>
  8. using namespace std;
  9. int main(int argc, char** argv) {
  10. cout << "hello world!" << endl;
  11. return 0;
  12. }
  13. ]])
  14. end)