-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a3619c
commit 61c5b61
Showing
7 changed files
with
187 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# GNU Make project makefile autogenerated by Premake | ||
|
||
ifndef config | ||
config=debug_any_cpu | ||
endif | ||
|
||
ifndef verbose | ||
SILENT = @ | ||
endif | ||
|
||
.PHONY: clean prebuild prelink | ||
|
||
ifeq ($(config),debug_any_cpu) | ||
CSC = mcs | ||
RESGEN = resgen | ||
TARGETDIR = ../bin | ||
TARGET = $(TARGETDIR)/slua-standalone-demo.exe | ||
OBJDIR = obj/Any\ CPU/Debug/slua-standalone-demo | ||
FLAGS = /unsafe /debug /noconfig /d:_DEBUG /d:DEBUG /d:TRACE | ||
DEPENDS = ../bin/slua-standalone.dll | ||
REFERENCES = /r:../bin/slua-standalone.dll | ||
define PREBUILDCMDS | ||
endef | ||
define PRELINKCMDS | ||
endef | ||
define POSTBUILDCMDS | ||
endef | ||
endif | ||
|
||
ifeq ($(config),release_any_cpu) | ||
CSC = mcs | ||
RESGEN = resgen | ||
TARGETDIR = ../bin | ||
TARGET = $(TARGETDIR)/slua-standalone-demo.exe | ||
OBJDIR = obj/Any\ CPU/Release/slua-standalone-demo | ||
FLAGS = /unsafe /optimize /noconfig | ||
DEPENDS = ../bin/slua-standalone.dll | ||
REFERENCES = /r:../bin/slua-standalone.dll | ||
define PREBUILDCMDS | ||
endef | ||
define PRELINKCMDS | ||
endef | ||
define POSTBUILDCMDS | ||
endef | ||
endif | ||
|
||
FLAGS += /t:exe | ||
REFERENCES += /r:System /r:../packages/NUnit.2.6.4/lib/nunit.framework.dll | ||
|
||
SOURCES += \ | ||
../slua-standalone-tests/Demo.cs \ | ||
../slua-standalone-tests/TestArray.cs \ | ||
../slua-standalone-tests/TestClass.cs \ | ||
../slua-standalone-tests/TestDLL.cs \ | ||
../slua-standalone-tests/TestEnum.cs \ | ||
../slua-standalone-tests/TestProperty.cs \ | ||
../slua-standalone-tests/TestSLua.cs \ | ||
../slua-standalone-tests/TestStruct.cs \ | ||
|
||
EMBEDFILES += \ | ||
|
||
RESPONSE += $(OBJDIR)/slua-standalone-demo.rsp | ||
SHELLTYPE := msdos | ||
ifeq (,$(ComSpec)$(COMSPEC)) | ||
SHELLTYPE := posix | ||
endif | ||
ifeq (/bin,$(findstring /bin,$(SHELL))) | ||
SHELLTYPE := posix | ||
endif | ||
|
||
all: $(TARGETDIR) $(OBJDIR) prebuild $(EMBEDFILES) $(COPYFILES) prelink $(TARGET) | ||
|
||
$(TARGET): $(SOURCES) $(EMBEDFILES) $(DEPENDS) $(RESPONSE) | ||
$(SILENT) $(CSC) /nologo /out:$@ $(FLAGS) $(REFERENCES) @$(RESPONSE) $(patsubst %,/resource:%,$(EMBEDFILES)) | ||
$(POSTBUILDCMDS) | ||
|
||
$(TARGETDIR): | ||
@echo Creating $(TARGETDIR) | ||
ifeq (posix,$(SHELLTYPE)) | ||
$(SILENT) mkdir -p $(TARGETDIR) | ||
else | ||
$(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) | ||
endif | ||
|
||
$(RESPONSE): slua-standalone-demo.make | ||
@echo Generating response file | ||
ifeq (posix,$(SHELLTYPE)) | ||
$(SILENT) rm -f $(RESPONSE) | ||
else | ||
$(SILENT) if exist $(RESPONSE) del $(OBJDIR)\slua-standalone-demo.rsp | ||
endif | ||
@echo ../slua-standalone-tests/Demo.cs >> $(RESPONSE) | ||
@echo ../slua-standalone-tests/TestArray.cs >> $(RESPONSE) | ||
@echo ../slua-standalone-tests/TestClass.cs >> $(RESPONSE) | ||
@echo ../slua-standalone-tests/TestDLL.cs >> $(RESPONSE) | ||
@echo ../slua-standalone-tests/TestEnum.cs >> $(RESPONSE) | ||
@echo ../slua-standalone-tests/TestProperty.cs >> $(RESPONSE) | ||
@echo ../slua-standalone-tests/TestSLua.cs >> $(RESPONSE) | ||
@echo ../slua-standalone-tests/TestStruct.cs >> $(RESPONSE) | ||
|
||
$(OBJDIR): | ||
@echo Creating $(OBJDIR) | ||
ifeq (posix,$(SHELLTYPE)) | ||
$(SILENT) mkdir -p $(OBJDIR) | ||
else | ||
$(SILENT) mkdir $(subst /,\\,$(OBJDIR)) | ||
endif | ||
|
||
prebuild: | ||
$(PREBUILDCMDS) | ||
|
||
prelink: | ||
$(PRELINKCMDS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using SLua; | ||
|
||
|
||
public class Demo | ||
{ | ||
private LuaSvr luaSvr; | ||
|
||
static public void Main() { | ||
Demo demo = new Demo(); | ||
demo.Init(); | ||
} | ||
|
||
public void Init() | ||
{ | ||
luaSvr = new LuaSvr(); | ||
luaSvr.init(null,onComplete); | ||
} | ||
void onComplete() { | ||
Console.WriteLine("complete"); | ||
string txt=@" | ||
local a=1 | ||
local b=2 | ||
print('result',a+b) | ||
"; | ||
LuaSvr.mainState.doString(txt); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters