GithubHelp home page GithubHelp logo

bindings-generator's People

Contributors

azmeuk avatar boyu0 avatar carlomorgantinizynga avatar colesbury avatar daviddesimone avatar dplusic avatar dualface avatar edwardzhou avatar folecr avatar jdmunro avatar jianglong-zz avatar led42 avatar lihex avatar minggo avatar pandamicro avatar ricardoquesada avatar rohankuruvilla avatar rolandoam avatar samuele3hu avatar samuele3hu2022 avatar sunlightjuly avatar teivaz avatar walzer avatar wenhailin avatar xbruce avatar xiaofeng11 avatar xpol avatar zhaijialong avatar zilongshanren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bindings-generator's Issues

overload function export to lua will error

Hi,
when two overload member function has the same params nums, the "ifunction_overloaded.c" will judge the first style and break.
same as,
C++:
void Node:addChild(Node* child, int localZOrder, const std::string &name)
void Node:addChild(Node* child, int localZOrder, int tag)

lua:
paraentNode:addChild(subNode, 100, "subNodeName")

...

path环境变量中不能有minGw的路径

我因为安装了qt创造器的minGw安装包,并且把minGw的bin目录加入了path,这样会导致"发现未声明的类型char16_t"等clang的编译错误。

Exception: Fatal error in parsing headers

6 warnings plus 1 error occur when I try to use llvm3.3 generate the binding code, seems warning wont affect much ,but error makes the process stop, Here is the error:

severity = Error,
location = SourceLocation file '/path/to/android-ndk-r9c//platforms/android-14/arch-arm/usr/include/math.h', line 532, column 5
details = "conflicting types for '__builtin_isnan'"

test.ini line 12 written mistake

simple_test_headers = -I%(cxxgeneratordir)s/test/simple_tes

might be

simple_test_headers = -I%(cxxgeneratordir)s/test/simple_test.h

plus can you guys add more specification about BG? Realy block a lot on this.

Wrong null callback parameter treating

When binding function with callback as parameter

void some_fun(int a, std::function<void()> callback)
{
    if(callback)
    {
        callback();
    }
}

A bindings-generator will create code like this:

do {
    std::shared_ptr<JSFunctionWrapper> func(new JSFunctionWrapper(cx, JS_THIS_OBJECT(cx, vp), argv[1]));
    auto lambda = [=]() -> void {
    ...
    };
    arg1 = lambda;
} while(0)
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_some_fun : Error processing arguments");
gaf::GAFAsset* ret = some_fun(arg0, arg1);

And when you call this function from js:

js_cocos2dx_some_fun(10, null);

a non-null lambda argument will be passed to the called function some_fun(10, <lambda>);
In some cases this will lead to crash.

Swift and other lang bindings?

Is this generator generic enough to bring in other languages with not a ton of work? GC langs could follow JS and non-GC langs could setup more direct bindings.

Or would it be better to find a more suitable tool (clang/llvm) for another language like Swift by means of a fork/port, such as the goal for PureSwift (and cocos2d-iphone before it).

Error parsing translation unit

Hello devs!

I'm trying to run genbindings.py, but unfortunately I'm seeing the error, mentioned in the subject.
I'm on Ubuntu 14.04, I followed the instructions and set everything up, I have all python stuff and I have Android NDK r9b, so theoretically it should work, but nope.

Full stack trace is this:

Traceback (most recent call last):
File "/home/stranger/Library/cocos2d-x-3.3/tools/bindings-generator/generator.py", line 1418, in
main()
File "/home/stranger/Library/cocos2d-x-3.3/tools/bindings-generator/generator.py", line 1414, in main
generator.generate_code()
File "/home/stranger/Library/cocos2d-x-3.3/tools/bindings-generator/generator.py", line 1087, in generate_code
self._parse_headers()
File "/home/stranger/Library/cocos2d-x-3.3/tools/bindings-generator/generator.py", line 1114, in _parse_headers
tu = self.index.parse(header, self.clang_args)
File "/home/stranger/Library/cocos2d-x-3.3/tools/bindings-generator/clang/cindex.py", line 2113, in parse
self)
File "/home/stranger/Library/cocos2d-x-3.3/tools/bindings-generator/clang/cindex.py", line 2225, in from_source
raise TranslationUnitLoadError("Error parsing translation unit.")

TranslationUnitLoadError: Error parsing translation unit.

Generating lua bindings fails.

Please tell me, maybe I forgot to do something or I can somehow get more detailed info about this error?

Documentation enhancement

The documentation explains how to generates jsbindings, but it does not tell the proper way to integrate it into a cocos2d-js project.

  • What steps should be followed?
  • Where manually written C++ files should be stored?
  • Where js and c++ generated files should be stored?
  • What CMakeList.txt files should be edited?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.