Support building Skeletool on Windows

* Do not include execinfo / backtrace (should implement Windows
  equivalent in the future)
* Define YAML_CPP_STATIC_DEFINE, which should have been set anyway
This commit is contained in:
Matt Penny 2024-01-14 00:33:45 -05:00
parent 77a17ab022
commit 394398b864
2 changed files with 13 additions and 9 deletions

View File

@ -3,13 +3,16 @@
#include <iostream>
#include <fstream>
#include <execinfo.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <assimp/postprocess.h>
#ifndef WIN32
#include <execinfo.h>
#endif
#include "src/SceneWriter.h"
#include "src/CommandLineParser.h"
#include "src/materials/MaterialParser.h"
@ -25,15 +28,16 @@
#include "src/lua_generator/LuaGenerator.h"
void handler(int sig) {
void *array[10];
size_t size;
// get void*'s for all entries on the stack
size = backtrace(array, 10);
// print out all the frames to stderr
fprintf(stderr, "Error: signal %d:\n", sig);
#ifndef WIN32
// TODO: proper backtraces on Windows
void *array[10];
size_t size = backtrace(array, 10);
backtrace_symbols_fd(array, size, STDERR_FILENO);
#endif
exit(1);
}

View File

@ -1,5 +1,5 @@
GCC_FLAGS = -Wall -Werror -g -rdynamic -I./yaml-cpp/include
GCC_FLAGS = -Wall -Werror -g -rdynamic -I./yaml-cpp/include -DYAML_CPP_STATIC_DEFINE
LINKER_FLAGS = -L./yaml-cpp -lassimp -lyaml-cpp -lpng -ltiff -llua5.4 -ldl