Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstarkos <none@none>2009-04-23 22:26:31 +0400
committerstarkos <none@none>2009-04-23 22:26:31 +0400
commit0301eee52b69b12ceacb4d3e66b402a3dab2efcf (patch)
tree9b48072d854ecf3848cdf426ea04e683b55a60a6 /tests/test_gmake_cpp.lua
parent66e7ffc8a0a04a60778b22698abaeb3e953b4d33 (diff)
Better handling of native platform during configuration building stage
Diffstat (limited to 'tests/test_gmake_cpp.lua')
-rw-r--r--tests/test_gmake_cpp.lua91
1 files changed, 91 insertions, 0 deletions
diff --git a/tests/test_gmake_cpp.lua b/tests/test_gmake_cpp.lua
new file mode 100644
index 0000000..70417d2
--- /dev/null
+++ b/tests/test_gmake_cpp.lua
@@ -0,0 +1,91 @@
+--
+-- tests/test_gmake_cpp.lua
+-- Automated test suite for GNU Make C/C++ project generation.
+-- Copyright (c) 2009 Jason Perkins and the Premake project
+--
+
+ T.gmake_cpp = { }
+
+--
+-- Configure a solution for testing
+--
+
+ local sln, prj
+ function T.gmake_cpp.setup()
+ sln = solution "MySolution"
+ configurations { "Debug", "Release" }
+ platforms { "native", "x64" }
+
+ prj = project "MyProject"
+ language "C++"
+ kind "ConsoleApp"
+
+ _ACTION = "gmake"
+ _OPTIONS.cc = "gcc"
+ _OPTIONS.os = "linux"
+ end
+
+ local function prepare()
+ io.capture()
+ premake.buildconfigs()
+ end
+
+
+
+ function T.gmake_cpp.BasicCfgBlock()
+ prepare()
+ local cfg = premake.getconfig(prj, "Debug")
+ premake.gmake_cpp_config(cfg)
+ test.capture [[
+ifeq ($(config),debug)
+ TARGETDIR = .
+ TARGET = $(TARGETDIR)/MyProject
+ OBJDIR = obj/Debug
+ DEFINES +=
+ INCLUDES +=
+ CPPFLAGS += -MMD $(DEFINES) $(INCLUDES)
+ CFLAGS += $(CPPFLAGS) $(ARCH)
+ CXXFLAGS += $(CFLAGS)
+ LDFLAGS += -s
+ RESFLAGS += $(DEFINES) $(INCLUDES)
+ LDDEPS +=
+ LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH)
+ define PREBUILDCMDS
+ endef
+ define PRELINKCMDS
+ endef
+ define POSTBUILDCMDS
+ endef
+endif
+ ]]
+ end
+
+
+
+ function T.gmake_cpp.PlatformSpecificBlock()
+ prepare()
+ local cfg = premake.getconfig(prj, "Debug", "x64")
+ premake.gmake_cpp_config(cfg)
+ test.capture [[
+ifeq ($(config),debug64)
+ TARGETDIR = .
+ TARGET = $(TARGETDIR)/MyProject
+ OBJDIR = obj/x64/Debug
+ DEFINES +=
+ INCLUDES +=
+ CPPFLAGS += -MMD $(DEFINES) $(INCLUDES)
+ CFLAGS += $(CPPFLAGS) $(ARCH) -m64
+ CXXFLAGS += $(CFLAGS)
+ LDFLAGS += -s -m64 -L/usr/lib64
+ RESFLAGS += $(DEFINES) $(INCLUDES)
+ LDDEPS +=
+ LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH)
+ define PREBUILDCMDS
+ endef
+ define PRELINKCMDS
+ endef
+ define POSTBUILDCMDS
+ endef
+endif
+ ]]
+ end