Advertisement
Guest User

Untitled

a guest
Oct 9th, 2015
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.23 KB | None | 0 0
  1. dofileopt { "premake5-system.lua", "premake-system.lua" }
  2. filter {}
  3.  
  4. local GBUILD_LOCATION = path.getdirectory( _SCRIPT )
  5.  
  6. -- Hack to allow multiple gmodule calls
  7. local targetSuffixes = {
  8.     ["windows"] = "_win32",
  9.     ["macosx"] =  "_osx",
  10.     ["linux"] =   "_linux"
  11. }
  12.  
  13. function gmodule( moduleName )
  14.     --
  15.     -- Super hacky way to allow gmodule to define its own solution
  16.     --
  17.     if not pcall( solution ) then
  18.         solution ( moduleName )
  19.             architecture "x86"
  20.             language     "C++"
  21.             location     "project"
  22.             targetdir    "bin"
  23.  
  24.             flags "StaticRuntime"
  25.  
  26.             configurations { "Debug", "Release" }
  27.  
  28.             configuration "Debug"
  29.                 flags "symbols"
  30.  
  31.             configuration "Release"
  32.                 optimize "On"
  33.     end
  34.  
  35.     project ( moduleName )
  36.         kind "SharedLib"
  37.  
  38.         local prefix = moduleName:match( "[^_]*" )
  39.  
  40.         if prefix ~= "gm" and prefix ~= "gmsv" and prefix ~= "gmcl" then
  41.             targetprefix "gm_"
  42.         end
  43.  
  44.         local suffix = moduleName:match( "[^_]*$" )
  45.  
  46.         if suffix ~= "win32" and suffix ~= "osx" and suffix ~= "linux" then
  47.             targetsuffix ( targetSuffixes[os.get()] or "_WHATHAVEYOUDONE" )
  48.         end
  49.  
  50.         targetextension ".dll"
  51. end
  52.  
  53. function ginclude( dependencyName )
  54.     dofile( path.join( GBUILD_LOCATION, "deps", dependencyName, "premake5.lua" ) )
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement