Skip to content

Commit

Permalink
Remove some code duplication in premake5 script
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelarius committed Feb 25, 2020
1 parent 459474e commit 8a002b4
Showing 1 changed file with 22 additions and 48 deletions.
70 changes: 22 additions & 48 deletions premake5.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
function imnodes_example_project(name, example_file)
project(name)
location(project_location)
kind "WindowedApp"
language "C++"
targetdir "bin/%{cfg.buildcfg}"
files {"example/main.cpp", path.join("example", example_file) }
includedirs { ".", "imgui", "gl3w/include" }
links { "gl3w", "imgui", "imnodes" }
filter { "action:gmake" }
buildoptions { "-std=c++11" }
filter "system:macosx"
includedirs { "/Library/Frameworks/SDL2.framework/Headers" }
linkoptions { "-F/Library/Frameworks -framework SDL2 -framework CoreFoundation" }
filter "system:linux"
includedirs { "/usr/include/SDL2" }
links { "SDL2", "dl" }
end

workspace "imnodes"
local project_location = ""
if _ACTION then
Expand Down Expand Up @@ -56,53 +75,8 @@ workspace "imnodes"
files { "imnodes.h", "imnodes.cpp" }
includedirs { "imgui" }

project "example"
location(project_location)
kind "WindowedApp"
language "C++"
targetdir "bin/%{cfg.buildcfg}"
files {"example/main.cpp", "example/simple.cpp" }
includedirs { ".", "imgui", "gl3w/include" }
links { "gl3w", "imgui", "imnodes" }
filter { "action:gmake" }
buildoptions { "-std=c++11" }
filter "system:macosx"
includedirs { "/Library/Frameworks/SDL2.framework/Headers" }
linkoptions { "-F/Library/Frameworks -framework SDL2 -framework CoreFoundation" }
filter "system:linux"
includedirs { "/usr/include/SDL2" }
links { "SDL2", "dl" }
imnodes_example_project("simple", "simple.cpp")

project "saveload"
location(project_location)
kind "WindowedApp"
language "C++"
targetdir "bin/%{cfg.buildcfg}"
files {"example/main.cpp", "example/save_load.cpp" }
includedirs { ".", "imgui", "gl3w/include" }
links { "gl3w", "imgui", "imnodes" }
filter { "action:gmake" }
buildoptions { "-std=c++11" }
filter "system:macosx"
includedirs { "/Library/Frameworks/SDL2.framework/Headers" }
linkoptions { "-F/Library/Frameworks -framework SDL2 -framework CoreFoundation" }
filter "system:linux"
includedirs { "/usr/include/SDL2" }
links { "SDL2", "dl" }
imnodes_example_project("saveload", "save_load.cpp")

project "colornode"
location(project_location)
kind "WindowedApp"
language "C++"
targetdir "bin/%{cfg.buildcfg}"
files {"example/main.cpp", "example/color_node_editor.cpp" }
includedirs { ".", "imgui", "gl3w/include" }
links { "gl3w", "imgui", "imnodes" }
filter { "action:gmake" }
buildoptions { "-std=c++11" }
filter "system:macosx"
includedirs { "/Library/Frameworks/SDL2.framework/Headers" }
linkoptions { "-F/Library/Frameworks -framework SDL2 -framework CoreFoundation" }
filter "system:linux"
includedirs { "/usr/include/SDL2" }
links { "SDL2", "dl" }
imnodes_example_project("colornode", "color_node_editor.cpp")

0 comments on commit 8a002b4

Please sign in to comment.