mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-20 14:11:16 +00:00
Add DEPFILE for asset command
This commit is contained in:
parent
08f75d19aa
commit
e4566bb93d
@ -650,6 +650,7 @@ endif()
|
|||||||
if(ISLE_BUILD_ASSETS)
|
if(ISLE_BUILD_ASSETS)
|
||||||
message(STATUS "Asset building is enabled")
|
message(STATUS "Asset building is enabled")
|
||||||
set(GENERATED_ASSETS_DIR "${CMAKE_BINARY_DIR}/assets")
|
set(GENERATED_ASSETS_DIR "${CMAKE_BINARY_DIR}/assets")
|
||||||
|
set(GENERATED_ASSETS_DEPFILE "${GENERATED_ASSETS_DIR}/.d")
|
||||||
|
|
||||||
add_executable(asset_generator EXCLUDE_FROM_ALL
|
add_executable(asset_generator EXCLUDE_FROM_ALL
|
||||||
assets/main.cpp
|
assets/main.cpp
|
||||||
@ -659,8 +660,9 @@ if(ISLE_BUILD_ASSETS)
|
|||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${GENERATED_ASSETS_DIR}/.stamp
|
OUTPUT ${GENERATED_ASSETS_DIR}/.stamp
|
||||||
|
DEPFILE ${GENERATED_ASSETS_DEPFILE}
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${GENERATED_ASSETS_DIR}
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${GENERATED_ASSETS_DIR}
|
||||||
COMMAND $<TARGET_FILE:asset_generator> ${GENERATED_ASSETS_DIR}
|
COMMAND $<TARGET_FILE:asset_generator> ${GENERATED_ASSETS_DIR} ${GENERATED_ASSETS_DEPFILE}
|
||||||
COMMAND ${CMAKE_COMMAND} -E touch ${GENERATED_ASSETS_DIR}/.stamp
|
COMMAND ${CMAKE_COMMAND} -E touch ${GENERATED_ASSETS_DIR}/.stamp
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/assets
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/assets
|
||||||
DEPENDS asset_generator
|
DEPENDS asset_generator
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
#include "mxdsaction.h"
|
#include "mxdsaction.h"
|
||||||
|
|
||||||
#include <file.h>
|
#include <file.h>
|
||||||
|
#include <filesystem>
|
||||||
|
#include <fstream>
|
||||||
#include <interleaf.h>
|
#include <interleaf.h>
|
||||||
#include <object.h>
|
#include <object.h>
|
||||||
|
|
||||||
@ -9,11 +11,13 @@ uint32_t bufferSize = 65536;
|
|||||||
uint32_t bufferCount = 8;
|
uint32_t bufferCount = 8;
|
||||||
|
|
||||||
std::string out;
|
std::string out;
|
||||||
|
std::ofstream depfile;
|
||||||
si::MemoryBuffer mxHd;
|
si::MemoryBuffer mxHd;
|
||||||
|
|
||||||
void CreateWidescreen()
|
void CreateWidescreen()
|
||||||
{
|
{
|
||||||
si::Interleaf si;
|
si::Interleaf si;
|
||||||
|
std::string file = out + "/widescreen.si";
|
||||||
mxHd.seek(0, si::MemoryBuffer::SeekStart);
|
mxHd.seek(0, si::MemoryBuffer::SeekStart);
|
||||||
si.Read(&mxHd);
|
si.Read(&mxHd);
|
||||||
|
|
||||||
@ -33,13 +37,15 @@ void CreateWidescreen()
|
|||||||
GaraDoor_Wide.up_.y = 1.0;
|
GaraDoor_Wide.up_.y = 1.0;
|
||||||
GaraDoor_Wide.ReplaceWithFile("widescreen/garadoor.bmp");
|
GaraDoor_Wide.ReplaceWithFile("widescreen/garadoor.bmp");
|
||||||
si.AppendChild(&GaraDoor_Wide);
|
si.AppendChild(&GaraDoor_Wide);
|
||||||
|
depfile << file << ": " << (std::filesystem::current_path() / "widescreen/garadoor.bmp").string() << std::endl;
|
||||||
|
|
||||||
si.Write((out + "/widescreen.si").c_str());
|
si.Write(file.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
out = argv[1];
|
out = argv[1];
|
||||||
|
depfile = std::ofstream(argv[2]);
|
||||||
|
|
||||||
mxHd.WriteU32(si::RIFF::MxHd);
|
mxHd.WriteU32(si::RIFF::MxHd);
|
||||||
mxHd.WriteU32(3 * sizeof(uint32_t));
|
mxHd.WriteU32(3 * sizeof(uint32_t));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user