Created
September 12, 2020 08:07
-
-
Save thomashope/9616970abefa3e3ff55fb7d7316aa907 to your computer and use it in GitHub Desktop.
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
require "config" | |
local name = config.appName | |
workspace (name) | |
configurations { "Debug", "Release" } | |
location ("build/" .. _ACTION) | |
project (name) | |
kind "WindowedApp" | |
location ("build/" .. _ACTION) | |
language "C++" | |
cppdialect "C++11" | |
targetdir ("bin/" .. _ACTION .. "/%{cfg.buildcfg}") | |
architecture "x86_64" | |
files { | |
"source/**.h", | |
"source/**.cpp", | |
} | |
includedirs { | |
"source/", | |
} | |
sysincludedirs { | |
"third_party/glm", | |
} | |
-- mac specific settings | |
filter "action:xcode4" | |
files { | |
"source/mac/Info.plist", | |
"source/mac/app.entitlements", | |
} | |
links { | |
-- application frameworks | |
"third_party/sdl2/macos/SDL2.framework", | |
} | |
sysincludedirs { | |
"third_party/sdl2/macos/SDL2.framework/Headers", | |
} | |
frameworkdirs { | |
"third_party/sdl2/macos/", | |
} | |
copylocal { -- don't think this actually works in current premake :( | |
"third_party/sdl2/macos/SDL2.framework", | |
} | |
xcodebuildsettings { | |
["MACOSX_DEPLOYMENT_TARGET"] = "10.11", | |
["PRODUCT_BUNDLE_IDENTIFIER"] = config.appleBundleId, | |
["CODE_SIGN_STYLE"] = "Automatic", | |
["DEVELOPMENT_TEAM"] = config.appleDevelopmentTeam, | |
["INFOPLIST_FILE"] = "../../source/mac/Info.plist", -- path relative to project file | |
["CODE_SIGN_ENTITLEMENTS"] = ("../../source/mac/app.entitlements"), -- path relative to project file | |
["ENABLE_HARDENED_RUNTIME"] = "YES" -- hardened runtime must be enabled for distribution | |
} | |
-- emscripten specific settings | |
filter "action:gmake*" | |
buildoptions { | |
-- "-s USE_SDL=2" | |
} | |
-- windows specific settings | |
filter "system:windows" | |
libdirs { | |
"third_party/sdl2/windows/lib/x64" | |
} | |
links { | |
"SDL2", | |
"SDL2main" | |
} | |
copylocal { -- doesn't actually work for c++ projects, so we have to do the post build command below | |
"SDL2" | |
} | |
postbuildcommands { | |
"{COPY} %{wks.location}/../../third_party/sdl2/windows/lib/x64/SDL2.dll %{cfg.buildtarget.directory}" | |
} | |
sysincludedirs { | |
"third_party/sdl2/windows/include" | |
} | |
flags { | |
"MultiProcessorCompile" | |
} | |
disablewarnings { | |
"26812" -- prefer enum class over enum | |
} | |
-- configuration specific settings | |
filter "configurations:Debug" | |
defines { | |
"DEBUG" | |
} | |
symbols "On" | |
targetname (name .. "_d") | |
filter "configurations:Release" | |
defines { | |
"NDEBUG" | |
} | |
optimize "On" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment