ssc/premake5.lua

66 lines
1.4 KiB
Lua
Raw Normal View History

2015-12-13 07:41:54 +09:00
workspace "ssc"
configurations { "Debug", "Release" }
targetdir "bin/%{cfg.buildcfg}"
2015-12-13 07:49:13 +09:00
libdirs { "lib" }
2015-12-13 07:41:54 +09:00
startproject "frontend"
filter "configurations:Debug"
defines { "DEBUG" }
flags { "Symbols" }
filter "configurations:Release"
defines { "RELEASE" }
optimize "On"
-- sunscript compiler API library
project "ssc"
kind "SharedLib"
language "C#"
namespace "arookas"
location "ssc"
links { "System", "arookas", "grammatica-1.6" }
2015-12-28 14:48:47 +09:00
files {
2015-12-13 07:41:54 +09:00
"ssc/**.cs",
"ssc/**.grammar",
"ssc/**.bat",
}
2015-12-28 14:48:47 +09:00
excludes {
2015-12-13 07:41:54 +09:00
"ssc/bin/**",
"ssc/obj/**",
}
2015-12-28 14:48:47 +09:00
prebuildcommands {
2015-12-13 07:41:54 +09:00
-- regenerate grammatica classes before compilation begins
"{CHDIR} \"%{prj.location}\"",
"java -jar grammatica.jar \"sunscript.grammar\" --csoutput \".\\generated\" --csnamespace \"arookas\" --csclassname \"__sun\"",
}
-- frontend project (example command-line interface)
project "frontend"
kind "ConsoleApp"
language "C#"
entrypoint "arookas.SSC"
namespace "arookas"
location "frontend"
links { "System", "arookas", "SSC" }
2015-12-28 14:48:47 +09:00
files {
2015-12-13 07:41:54 +09:00
"frontend/**.cs",
}
2015-12-28 14:48:47 +09:00
excludes {
2015-12-13 07:41:54 +09:00
"frontend/bin/**",
"frontend/obj/**",
}
2015-12-28 14:48:47 +09:00
postbuildcommands {
2015-12-13 07:41:54 +09:00
-- copy stdlib to frontend output so users can import the scripts
"{RMDIR} \"%{cfg.buildtarget.directory}ssc\"",
"{COPY} \"%{wks.location}stdlib\" \"%{cfg.buildtarget.directory}ssc\"",
}