Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/build/premake/cxxtest/cxxtest.lua
Show All 22 Lines | function m.configure_project(rootfile, hdrfiles, rootoptions, testoptions) | ||||
local rootpath = path.getabsolute(rootfile) | local rootpath = path.getabsolute(rootfile) | ||||
-- Add headers | -- Add headers | ||||
for _,hdrfile in ipairs(hdrfiles) do | for _,hdrfile in ipairs(hdrfiles) do | ||||
files { hdrfile } | files { hdrfile } | ||||
end | end | ||||
-- Generate the root file | |||||
prebuildmessage 'Generating test root file' | |||||
prebuildcommands { abspath.." --root "..rootoptions.." -o "..rootpath } | |||||
-- Generate the source files from headers | -- Generate the source files from headers | ||||
-- This first one is a hack, precompiled has nothing to do with the test runner, | |||||
-- but we need to make the file compilation depend on its generation (which | |||||
-- buildoutputs does). | |||||
-- Ideally premake should have an API to specify pre-build commands per file. | |||||
filter { "files:**precompiled.h" } | |||||
buildmessage 'Generating root file' | |||||
buildcommands { abspath.." --root "..rootoptions.." -o "..rootpath } | |||||
buildoutputs { rootpath } | |||||
filter { "files:**.h", "files:not **precompiled.h" } | filter { "files:**.h", "files:not **precompiled.h" } | ||||
buildmessage 'Generating %{file.basename}.cpp' | buildmessage 'Generating %{file.basename}.cpp' | ||||
buildcommands { abspath.." --part "..testoptions.." -o %{file.directory}/%{file.basename}.cpp %{file.relpath}" } | buildcommands { abspath.." --part "..testoptions.." -o %{file.directory}/%{file.basename}.cpp %{file.relpath}" } | ||||
buildoutputs { "%{file.directory}/%{file.basename}.cpp" } | buildoutputs { "%{file.directory}/%{file.basename}.cpp" } | ||||
filter {} | filter {} | ||||
-- Add source files | -- Add source files | ||||
Show All 9 Lines |
Wildfire Games · Phabricator