From f5052dbbce9d3920f4311b8e0e3ad625b08c84b4 Mon Sep 17 00:00:00 2001 From: Gordon McCann Date: Thu, 26 Aug 2021 09:24:27 -0400 Subject: [PATCH] Added (probable) Windows compatibility, needs testing to verify --- premake5.lua | 53 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/premake5.lua b/premake5.lua index f87e299..4cd98ee 100644 --- a/premake5.lua +++ b/premake5.lua @@ -17,20 +17,45 @@ project "Mask" "src/**.cxx" } - includedirs { - "include", - "./" - } - - buildoptions { - "`root-config --cflags`" - } - - linkoptions { - "`root-config --glibs`" - } - prebuildcommands { "rootcint -f src/kinematics_dict.cxx include/Kinematics.h include/LinkDef_Kinematics.h", "{MOVE} src/kinematics_dict_rdict.pcm bin/" - } \ No newline at end of file + } + + filter "system:windows" + systemversion "latest" + --ROOT cannot be located using the config tools, so we must query for the ROOTSYS env variable + --Have to use an if statement to hide this (@penguin for example doesn't have a ROOTSYS) + if os.host() == windows then + rootpath = os.getenv("ROOTSYS") + + includedirs { + "include", + "./", + rootpath .. "include" + } + + links { + rootpath .. "lib/**.lib" + } + end + + filter "system:macosx or linux" + includedirs { + "include", + "./" + } + + buildoptions { + "`root-config --cflags`" + } + + linkoptions { + "`root-config --glibs`" + } + + filter "configurations:Debug" + symbols "On" + + filter "configurations:Release" + optimize "On" \ No newline at end of file