From 7e037e4d6fcf2059b13c9e4e24de72f22bba5b6b Mon Sep 17 00:00:00 2001 From: Lynix Date: Thu, 5 May 2016 23:36:34 +0200 Subject: [PATCH] Build: Add an option to copy the built library to the example directory Former-commit-id: e9b2df26e19917355e3bbc486892f2aeead2ae0e --- .gitignore | 2 ++ build/scripts/common.lua | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index d671b209b..258594792 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ # Nazara build examples/bin/*.exe examples/bin/*.pdb +examples/bin/*.dll +examples/bin/*.so tests/*.exe tests/*.pdb lib/* diff --git a/build/scripts/common.lua b/build/scripts/common.lua index 266b50f85..405b66b60 100644 --- a/build/scripts/common.lua +++ b/build/scripts/common.lua @@ -298,6 +298,14 @@ function NazaraBuild:Execute() targetdir("../plugins/" .. toolTable.Name .. "/lib/" .. makeLibDir .. "/x64") end + -- Copy the module binaries to the example folder + if (toolTable.CopyTargetToExampleDir) then + if (os.is("windows")) then + configuration({}) + postbuildcommands({[[xcopy "%{path.translate(cfg.linktarget.relpath):sub(1, -5) .. ".dll"}" "..\..\..\examples\bin\" /E /Y]]}) + end + end + configuration({"vs*", "x32"}) libdirs("../extlibs/lib/msvc/x86") libdirs("../lib/msvc/x86")