Skip to content

Instantly share code, notes, and snippets.

@adrianjmejias
Created July 31, 2019 17:03
Show Gist options
  • Select an option

  • Save adrianjmejias/f86dfe1815593225f732280bd315d099 to your computer and use it in GitHub Desktop.

Select an option

Save adrianjmejias/f86dfe1815593225f732280bd315d099 to your computer and use it in GitHub Desktop.
c++ library development template
-- premake5.lua
-- https://git-scm.com/book/en/v2/Git-Tools-Submodules
outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"
libName = "CachapaDS"
libType = "StaticLib" -- uncomment for .lib
-- libType = "SharedLib" -- uncomment for dll
appName = "Playground"
workspace(libName)
architecture "x64"
startproject(appName)
configurations { "Debug", "Release", "Dist"}
project(libName)
location(libName)
kind (libType)
language "C++"
cppdialect "C++17"
targetdir ("bin/" .. outputdir .. "/%{prj.name}")
objdir ("bin-int/" .. outputdir .. "/%{prj.name}")
files {
"%{prj.name}/src/**.cpp",
"%{prj.name}/cds/**.h",
}
filter "configurations:Debug"
defines { "_CRT_SECURE_NO_WARNINGS", "DEBUG"}
symbols "On"
filter "configurations:Release"
defines { "NDEBUG" }
optimize "On"
project(appName)
location(appName)
kind "ConsoleApp"
language "C++"
cppdialect "C++17" --StaticLib
targetdir ("bin/" .. outputdir .. "/%{prj.name}")
objdir ("bin-int/" .. outputdir .. "/%{prj.name}")
includedirs{
libName
}
links{libName}
files {
"%{prj.name}/*/**.cpp",
}
filter "configurations:Debug"
defines { "DEBUG" }
symbols "On"
filter "system:windows"
systemversion "latest"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment