|
|
|
@ -11,6 +11,12 @@ solution "Symmetry" |
|
|
|
|
configuration {"windows", "vs2017"} |
|
|
|
|
defines {"_CRT_SECURE_NO_WARNINGS"} |
|
|
|
|
flags {"NoIncrementalLink", "NoEditAndContinue"} |
|
|
|
|
local windowsPlatform = string.gsub(os.getenv("WindowsSDKVersion") or "10.0.16299.0", "\\", "") |
|
|
|
|
local action = premake.action.current() |
|
|
|
|
if(action ~= nil) then |
|
|
|
|
action.vstudio.windowsTargetPlatformVersion = windowsPlatform |
|
|
|
|
action.vstudio.windowsTargetPlatformMinVersion = windowsPlatform |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
configuration "Debug" |
|
|
|
|
if (_ACTION ~= nil and _ACTION ~= "postbuild_copy") then |
|
|
|
@ -28,6 +34,27 @@ solution "Symmetry" |
|
|
|
|
defines { "NDEBUG", "ExtraWarnings" } |
|
|
|
|
flags { "OptimizeSpeed"} |
|
|
|
|
|
|
|
|
|
newaction { |
|
|
|
|
trigger = "postbuild_copy", |
|
|
|
|
description = "Action to copy relevant dlls to executable directory after build", |
|
|
|
|
execute = function () |
|
|
|
|
-- local copy_dest_dir = "" |
|
|
|
|
-- local symlink_dest_dir = "" |
|
|
|
|
|
|
|
|
|
-- if(_ARGS[1] == "vs2017") then |
|
|
|
|
-- copy_dest_dir = "vs2017" |
|
|
|
|
-- symlink_dest_dir = "..\\..\\..\\assets" |
|
|
|
|
-- printf("Copying DLLs to visual studio build directory...\n") |
|
|
|
|
-- end |
|
|
|
|
|
|
|
|
|
-- -- Create sym links |
|
|
|
|
-- local output = os.outputof("mklink /D vs2017\\debug\\assets ..\\..\\..\\assets" .. path.translate(copy_dest_dir, "\\") .. "\\debug\\assets " .. symlink_dest_dir) |
|
|
|
|
-- printf("MKlink debug output : %s", output) |
|
|
|
|
-- output = os.outputof("mklink /D " .. path.translate(copy_dest_dir, "\\") .. "\\release\\assets " ..symlink_dest_dir) |
|
|
|
|
-- printf("MKlink release output : %s", output) |
|
|
|
|
end |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
------------------------- |
|
|
|
|
-- Game |
|
|
|
|
------------------------- |
|
|
|
@ -44,74 +71,41 @@ solution "Symmetry" |
|
|
|
|
links {"SDL2", "m"} |
|
|
|
|
|
|
|
|
|
configuration {"windows", "vs2017"} |
|
|
|
|
includedirs {"../include/windows/sdl2/", "../include/common/soloud/"} |
|
|
|
|
libdirs {"../lib/windows/sdl2/", "../lib/windows/soloud/"} |
|
|
|
|
includedirs {"../include/windows/sdl2/", "../include/common/soloud/", "../include/common/newton/"} |
|
|
|
|
libdirs {"../lib/windows/sdl2/", "../lib/windows/soloud/", "../lib/windows/newton/"} |
|
|
|
|
links {"SDL2"} |
|
|
|
|
|
|
|
|
|
configuration "Debug" |
|
|
|
|
links {"soloud_x64_d"} |
|
|
|
|
links {"soloud_x64_d", "newton_d"} |
|
|
|
|
|
|
|
|
|
configuration "Release" |
|
|
|
|
links {"soloud_x64"} |
|
|
|
|
links {"soloud_x64", "newton"} |
|
|
|
|
|
|
|
|
|
configuration {"windows", "Release", "vs2017"} |
|
|
|
|
postbuildcommands { |
|
|
|
|
postbuildcommands |
|
|
|
|
{ |
|
|
|
|
"copy ..\\..\\lib\\windows\\sdl2\\SDL2.dll release\\ /Y", |
|
|
|
|
"copy ..\\..\\lib\\windows\\soloud\\soloud_x64.dll release\\ /Y", |
|
|
|
|
"copy ..\\..\\lib\\windows\\newton\\newton.dll release\\ /Y", |
|
|
|
|
"xcopy ..\\..\\assets ..\\..\\bin\\assets /s /e /h /i /y /d", |
|
|
|
|
"copy release\\Symmetry.exe ..\\..\\bin\\ /Y", |
|
|
|
|
"copy release\\libSymmetry.dll ..\\..\\bin\\ /Y", |
|
|
|
|
"copy release\\SDL2.dll ..\\..\\bin\\ /Y", |
|
|
|
|
"copy release\\soloud_x64.dll ..\\..\\bin\\ /Y", |
|
|
|
|
"copy release\\newton.dll ..\\..\\bin\\ /Y", |
|
|
|
|
"rmdir release\\assets", |
|
|
|
|
"mklink /D release\\assets ..\\..\\..\\assets" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
newaction { |
|
|
|
|
trigger = "postbuild_copy", |
|
|
|
|
description = "Action to copy relevant dlls to executable directory after build", |
|
|
|
|
execute = function () |
|
|
|
|
local copy_dest_dir = "" |
|
|
|
|
local symlink_dest_dir = "" |
|
|
|
|
|
|
|
|
|
if(_ARGS[1] == "vs2017") then |
|
|
|
|
copy_dest_dir = "vs2017" |
|
|
|
|
symlink_dest_dir = "..\\..\\..\\assets" |
|
|
|
|
printf("Copying DLLs to visual studio build directory...\n") |
|
|
|
|
else |
|
|
|
|
copy_dest_dir = "projects/qbs" |
|
|
|
|
symlink_dest_dir = "..\\..\\..\\..\\assets" |
|
|
|
|
printf("Copying DLLs to qbs build directory...\n") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
local success = false |
|
|
|
|
success = os.copyfile("../libs/windows/sdl2/SDL2.dll", copy_dest_dir .. "/debug/SDL2.dll") |
|
|
|
|
success = os.copyfile("../libs/windows/sdl2/SDL2.dll", copy_dest_dir .. "/release/SDL2.dll") |
|
|
|
|
success = os.copyfile("../libs/windows/soloud_x64_d.dll", copy_dest_dir .. "/debug/soloud_x64_d.dll") |
|
|
|
|
success = os.copyfile("../libs/windows/soloud_x64.dll", copy_dest_dir .. "/release/soloud_x64.dll") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if success ~= true then |
|
|
|
|
printf("Copying one or more dlls failed.") |
|
|
|
|
else |
|
|
|
|
printf("Copying dlls successful.") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
-- Create sym links |
|
|
|
|
local output = os.outputof("mklink /D " .. path.translate(copy_dest_dir, "\\") .. "\\debug\\assets " .. symlink_dest_dir) |
|
|
|
|
printf("MKlink debug output : %s", output) |
|
|
|
|
output = os.outputof("mklink /D " .. path.translate(copy_dest_dir, "\\") .. "\\release\\assets " ..symlink_dest_dir) |
|
|
|
|
printf("MKlink release output : %s", output) |
|
|
|
|
end |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(_ACTION == "vs2017") then |
|
|
|
|
postbuildcommands |
|
|
|
|
{ |
|
|
|
|
_PREMAKE_COMMAND .. " postbuild_copy vs2017" |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
configuration {"windows", "Debug", "vs2017"} |
|
|
|
|
postbuildcommands |
|
|
|
|
{ |
|
|
|
|
_PREMAKE_COMMAND .. " postbuild_copy qbs" |
|
|
|
|
"copy ..\\..\\lib\\windows\\sdl2\\SDL2.dll debug\\ /Y", |
|
|
|
|
"copy ..\\..\\lib\\windows\\soloud\\soloud_x64_d.dll debug\\ /Y", |
|
|
|
|
"copy ..\\..\\lib\\windows\\newton\\newton_d.dll debug\\ /Y", |
|
|
|
|
"rmdir debug\\assets", |
|
|
|
|
"mklink /D debug\\assets ..\\..\\..\\assets" |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
------------------------- |
|
|
|
|
-- libSymmetry |
|
|
|
|
------------------------- |
|
|
|
|