Advertisement
Guest User

premake5.lua

a guest
Apr 15th, 2016
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.53 KB | None | 0 0
  1. -- premake5.lua
  2. -- Declare globals
  3. --------------------------------------------------------------------------------
  4. BUILD_DIR       = ".build/"
  5. BIN_DIR         = ".bin/"
  6. LOCAL_INCLUDE   = "include/"
  7. LOCAL_SOURCE    = "src/"
  8. LIBRARY_DIR     = ".libraries/"
  9. EXAMPLE_DIR     = "example/"
  10.  
  11. WORKSPACE_NAME  = "SFML_Project"
  12. LIBRARY_NAME    = "App"
  13. EXECUTABLE_NAME = "Example"
  14.  
  15. SFML_DIR        = "SFML-2.3.2-Win32"
  16. -- !globals
  17.  
  18. -- Declare workspaces
  19. --------------------------------------------------------------------------------
  20. workspace ( WORKSPACE_NAME )
  21.   configurations ( { "Debug", "Release" } )
  22.   location ( BUILD_DIR )
  23.  
  24.   -- Declare projects
  25.   ------------------------------------------------------------------------------
  26.   project ( LIBRARY_NAME )
  27.     kind ( "SharedLib" )
  28.     language ( "C++" )
  29.     includedirs ( { LIBRARY_DIR .. SFML_DIR .. "/include", LOCAL_INCLUDE } )
  30.     libdirs ( { LIBRARY_DIR .. SFML_DIR .. "/lib" } )
  31.     location ( BUILD_DIR .. LIBRARY_NAME )
  32.     targetdir ( BIN_DIR .. LIBRARY_NAME .. "/%{cfg.buildcfg}" )
  33.     files ( { LOCAL_INCLUDE .. "**.h", LOCAL_SOURCE .. "**.cpp" } )
  34.  
  35.     -- Declare filters
  36.     ----------------------------------------------------------------------------
  37.     -- Debug configuration
  38.     filter ( "configurations:Debug" )
  39.       defines ( { "APP_DEBUG", "APP_EXPORTS" } )
  40.       flags ( { "Symbols" } )
  41.       links ( { "sfml-system-d", "sfml-window-d", "sfml-graphics-d" } )
  42.     -- Release configuration
  43.     filter ( "configurations:Release" )
  44.       defines ( { "APP_NDEBUG", "APP_EXPORTS" } )
  45.       optimize ( "On" )
  46.       links ( { "sfml-system", "sfml-window", "sfml-graphics" } )
  47.     -- !filters
  48.  
  49.   project ( EXECUTABLE_NAME )
  50.     kind ( "ConsoleApp" )
  51.     language ( "C++" )
  52.     includedirs ( { LIBRARY_DIR .. SFML_DIR .. "/include", LOCAL_INCLUDE } )
  53.     libdirs ( { BIN_DIR .. LIBRARY_NAME .. "/%{cfg.buildcfg}" } )
  54.     location ( BUILD_DIR .. EXECUTABLE_NAME )
  55.     targetdir ( BIN_DIR .. EXECUTABLE_NAME .. "/%{cfg.buildcfg}" )
  56.     files ( { EXAMPLE_DIR .. "**.h", EXAMPLE_DIR .. "**.cpp" } )
  57.  
  58.     -- Declare filters
  59.     ----------------------------------------------------------------------------
  60.     -- Debug configuration
  61.     filter ( "configurations:Debug" )
  62.       defines ( { "EXAMPLPE_DEBUG" } )
  63.       flags ( { "Symbols" } )
  64.       links ( { LIBRARY_NAME } )
  65.     -- Release configuration
  66.     filter ( "configurations:Release" )
  67.       defines ( { "EXAMPLE_NDEBUG" } )
  68.       optimize ( "On" )
  69.       links ( { LIBRARY_NAME } )
  70.   -- !projects
  71. -- !workspaces
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement