Browse Source

Update hello world project, tune interface to be autogenerated, add lua projects for c++ and c# code

add project files to gitignore.
pull/1/head
Tarmo Pikaro 13 years ago committed by triton
parent
commit
eba93b24da
  1. 16
      examples/Hello/Hello.cpp
  2. 5
      examples/Hello/Hello.cs
  3. 3
      examples/Hello/Hello.h
  4. 1
      examples/Hello/makeSln.bat
  5. 51
      examples/Hello/premake4.lua

16
examples/Hello/Hello.cpp

@ -3,22 +3,16 @@ @@ -3,22 +3,16 @@
using namespace std;
void
Hello::PrintHello ()
Hello::Hello ()
{
cout << "Hello, World!\n";
}
Hello::Hello ()
void Hello::PrintHello(const char* s)
{
cout << "PrintHello: " << s << "\n";
}
int
main ()
bool Hello::test1(int i, float f)
{
Hello h;
h.PrintHello ();
return 0;
return i == f;
}

5
examples/Hello/Hello.cs

@ -1,10 +1,11 @@ @@ -1,10 +1,11 @@
using System;
using CppCsBind;
public class HelloExample
{
public static void Main (String[] args) {
var h = new Hello.Hello ();
h.PrintHello ();
var h = new Hello();
h.PrintHello ("Hello world");
}
}

3
examples/Hello/Hello.h

@ -4,5 +4,6 @@ class Hello @@ -4,5 +4,6 @@ class Hello
public:
Hello ();
void PrintHello ();
void PrintHello(const char* s);
bool test1(int i, float f);
};

1
examples/Hello/makeSln.bat

@ -0,0 +1 @@ @@ -0,0 +1 @@
@..\..\build\premake4.exe vs2010

51
examples/Hello/premake4.lua

@ -0,0 +1,51 @@ @@ -0,0 +1,51 @@
common_flags = { } -- Otherwise /clr won't be enabled - bug ?
solution "Hello"
platforms { "x32" }
configurations { "Debug", "Release" }
objdir ( "./obj/" )
targetdir ("./bin/")
debugdir ( "./bin/")
configuration "Debug"
defines { "DEBUG" }
configuration "Release"
defines { "NDEBUG" }
flags { "Optimize" }
project "Hello"
kind "SharedLib"
language "C++"
location "."
platforms { "x32" }
flags { common_flags, "Managed" }
configuration "*"
buildoptions { common_msvc_copts, "/clr" }
files { "**.h", "**.cpp", "./*.lua" }
configuration "hello.h"
buildrule {
description = "Compiling $(InputFile)...",
commands = {
'..\\..\\bin\\generator.exe -ns=CppCsBind -outdir=CppCsBind -I. hello.h',
},
outputs = { "CppCsBind\\hello.cpp" }
}
project "SayHello"
kind "ConsoleApp"
language "C#"
location "."
platforms { "x32" }
files { "**.cs", "./*.lua" }
links { "Hello" }
Loading…
Cancel
Save