Updated to use the latest libgit2 1.9.0 and GCC14.
This commit is contained in:
parent
62785d463c
commit
2d81f900be
10 changed files with 29 additions and 35 deletions
4
Makefile
4
Makefile
|
@ -4,7 +4,7 @@ reset:
|
|||
powershell -executionpolicy bypass .\scripts\reset_build.ps1
|
||||
|
||||
patch:
|
||||
powershell "cp ./patches/process.h ./subprojects/libgit2-1.8.1/src/util/process.h"
|
||||
powershell "cp ./patches/process.h ./subprojects/libgit2-1.9.0/src/util/process.h"
|
||||
|
||||
build: patch
|
||||
meson compile -j 4 -C builddir
|
||||
|
@ -17,7 +17,7 @@ test: build
|
|||
|
||||
# make an install for real maybe copy dll and .exe to dir and zip?
|
||||
install: build test
|
||||
powershell "cp ./builddir/subprojects/libgit2-1.8.1/liblibgit2package.dll ."
|
||||
powershell "cp ./builddir/subprojects/libgit2-1.9.0/liblibgit2package.dll ."
|
||||
powershell "cp ./builddir/subprojects/efsw/libefsw.dll ."
|
||||
powershell "cp builddir/escape_turings_tarpit.exe ."
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "dbc.hpp"
|
||||
|
||||
using std::string;
|
||||
using namespace fmt;
|
||||
using namespace nlohmann;
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
|
@ -92,7 +91,7 @@ void Builder::BUILDING(BuildEvent ev) {
|
|||
auto m = parse_line(line);
|
||||
|
||||
if(m.match) {
|
||||
gui.output(format("HIT WITH {} @ {}:{}:{} {}", m.type, m.file_name, m.lnumber, m.col, m.message));
|
||||
gui.output(fmt::format("HIT WITH {} @ {}:{}:{} {}", m.type, m.file_name, m.lnumber, m.col, m.message));
|
||||
game.event(GameEvent::HIT, m.type);
|
||||
}
|
||||
state(BuildState::READING);
|
||||
|
@ -100,7 +99,7 @@ void Builder::BUILDING(BuildEvent ev) {
|
|||
}
|
||||
|
||||
void Builder::START(BuildEvent ev) {
|
||||
gui.output(format("Using build command: {}", build_cmd));
|
||||
gui.output(fmt::format("Using build command: {}", build_cmd));
|
||||
fileWatcher = new efsw::FileWatcher();
|
||||
dbc::check(fileWatcher != nullptr, "Failed to create filewatcher.");
|
||||
|
||||
|
@ -112,7 +111,7 @@ void Builder::START(BuildEvent ev) {
|
|||
listener = new UpdateListener(repo);
|
||||
dbc::check(listener != nullptr, "Failed to create listener.");
|
||||
|
||||
gui.output(format("Watching directory {} for changes...", git_path));
|
||||
gui.output(fmt::format("Watching directory {} for changes...", git_path));
|
||||
wid = fileWatcher->addWatch(git_path, listener, true);
|
||||
fileWatcher->watch();
|
||||
|
||||
|
@ -123,7 +122,7 @@ void Builder::WAITING(BuildEvent ev) {
|
|||
if(listener->changes) {
|
||||
game.event(GameEvent::BUILD_START);
|
||||
gui.building();
|
||||
gui.output(format("CHANGES! Running build {}", build_cmd));
|
||||
gui.output(fmt::format("CHANGES! Running build {}", build_cmd));
|
||||
state(BuildState::FORKING);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
const auto ERROR = fmt::emphasis::bold | fg(fmt::color::red);
|
||||
|
||||
using namespace fmt;
|
||||
using namespace std;
|
||||
|
||||
GameEngine::GameEngine(int hp) : starting_hp(hp) {
|
||||
|
@ -21,13 +20,13 @@ int GameEngine::determine_damage(string &type) {
|
|||
try {
|
||||
return damage_types.at(type);
|
||||
} catch(std::out_of_range &err) {
|
||||
print(ERROR, "BAD DAMAGE TYPE {}\n", type);
|
||||
fmt::print(ERROR, "BAD DAMAGE TYPE {}\n", type);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void GameEngine::reset() {
|
||||
println("!!!!!!! RESET hit_points={}, max={}", hit_points, max_hp());
|
||||
fmt::println("!!!!!!! RESET hit_points={}, max={}", hit_points, max_hp());
|
||||
if(free_death) {
|
||||
hit_points = max_hp() * 0.5f;
|
||||
} else {
|
||||
|
@ -35,7 +34,7 @@ void GameEngine::reset() {
|
|||
hit_points = max_hp();
|
||||
}
|
||||
|
||||
println("!!!!!!!! AFTER RESET hit_points={}, max={}", hit_points, max_hp());
|
||||
fmt::println("!!!!!!!! AFTER RESET hit_points={}, max={}", hit_points, max_hp());
|
||||
|
||||
free_death = false;
|
||||
}
|
||||
|
|
3
gui.cpp
3
gui.cpp
|
@ -13,7 +13,6 @@
|
|||
|
||||
using std::string, std::vector;
|
||||
|
||||
using namespace fmt;
|
||||
using namespace nlohmann;
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
|
@ -54,7 +53,7 @@ void GUI::build_failed(bool play_sound, const string &command) {
|
|||
build_failed_sound.play();
|
||||
}
|
||||
|
||||
output(format("!!! BUILD FAILED. Your command correct? '{}'", command));
|
||||
output(fmt::format("!!! BUILD FAILED. Your command correct? '{}'", command));
|
||||
}
|
||||
|
||||
void GUI::you_died() {
|
||||
|
|
|
@ -5,7 +5,7 @@ cmake = import('cmake')
|
|||
opts = cmake.subproject_options()
|
||||
opts.add_cmake_defines({
|
||||
'USE_ICONV': false,
|
||||
'USE_SSH': false,
|
||||
#'USE_SSH': false,
|
||||
'USE_NTLMCLIENT': false,
|
||||
'BUILD_SHARED_LIBS': true,
|
||||
'BUILD_TESTS': false,
|
||||
|
@ -14,7 +14,7 @@ libgit2_proj = cmake.subproject('libgit2', options: opts)
|
|||
libgit2package = libgit2_proj.dependency('libgit2package')
|
||||
|
||||
efsw = dependency('efsw')
|
||||
fmt = dependency('fmt')
|
||||
fmt = subproject('fmt').get_variable('fmt_dep')
|
||||
catch2 = dependency('catch2-with-main')
|
||||
sfml = dependency('sfml')
|
||||
json = dependency('nlohmann_json')
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#ifndef INCLUDE_process_h__
|
||||
#define INCLUDE_process_h__
|
||||
|
||||
typedef struct git_str git_str;
|
||||
typedef struct git_process git_process;
|
||||
|
||||
typedef struct {
|
||||
|
@ -113,10 +112,7 @@ extern int git_process__cmdline(
|
|||
* cmdline arguments to ensure that they are not erroneously treated
|
||||
* as an option. For example, arguments to `ssh`.
|
||||
*/
|
||||
static __inline__ bool git_process__is_cmdline_option(const char *str)
|
||||
{
|
||||
return (str && str[0] == '-');
|
||||
}
|
||||
#define git_process__is_cmdline_option(S) ((S) && (S)[0] == '-')
|
||||
|
||||
/**
|
||||
* Start the process.
|
||||
|
@ -211,7 +207,7 @@ extern int git_process_close(git_process *process);
|
|||
* @param msg the buffer to store the message
|
||||
* @param result the process result that produced an error
|
||||
*/
|
||||
extern int git_process_result_msg(git_str *msg, git_process_result *result);
|
||||
extern int git_process_result_msg(struct git_str *msg, git_process_result *result);
|
||||
|
||||
/**
|
||||
* Free a process structure
|
||||
|
|
|
@ -13,8 +13,8 @@ executable('threadtest', 'threadtest.cpp',
|
|||
executable('badref', 'badref.cpp',
|
||||
dependencies: dependencies)
|
||||
|
||||
executable('corotest', [
|
||||
'corotest.cpp'
|
||||
],
|
||||
dependencies: dependencies,
|
||||
cpp_args: '-fcoroutines')
|
||||
#executable('corotest', [
|
||||
# 'corotest.cpp'
|
||||
# ],
|
||||
# dependencies: dependencies,
|
||||
# cpp_args: '-fcoroutines')
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
using namespace fmt;
|
||||
using namespace nlohmann;
|
||||
using std::string;
|
||||
|
||||
|
@ -36,7 +35,7 @@ void SoundQuip::load(json &data, const char *file_key, bool loop) {
|
|||
json::string_t file_name = audio[file_key].template get<string>();
|
||||
|
||||
if(!buffer.loadFromFile(file_name)) {
|
||||
println("Failed to load sound: {} with file {}", file_key, file_name);
|
||||
fmt::println("Failed to load sound: {} with file {}", file_key, file_name);
|
||||
}
|
||||
|
||||
sound.setBuffer(buffer);
|
||||
|
@ -157,7 +156,7 @@ void SFMLBackend::update_entities() {
|
|||
|
||||
auto elapsed_time = std::chrono::system_clock::now() - clock_start;
|
||||
|
||||
string time = format("{:%H:%M:%OS}", elapsed_time);
|
||||
string time = fmt::format("{:%H:%M:%OS}", elapsed_time);
|
||||
write_text(7, 14, time, 2.0f);
|
||||
|
||||
|
||||
|
@ -215,7 +214,7 @@ void SFMLBackend::startup() {
|
|||
fmt::println("Cannot load font.");
|
||||
}
|
||||
|
||||
window.setPosition({.x=0,.y=0});
|
||||
window.setPosition({0,0});
|
||||
|
||||
window.setFramerateLimit(FPS);
|
||||
window.setVerticalSyncEnabled(true);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "watcher.hpp"
|
||||
#include <filesystem>
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
|
||||
using std::string;
|
||||
namespace fs = std::filesystem;
|
||||
|
@ -10,7 +12,6 @@ void UpdateListener::handleFileAction(efsw::WatchID watchid,
|
|||
efsw::Action action,
|
||||
string oldFilename)
|
||||
{
|
||||
|
||||
// this is some gnarly BS here, probably tons
|
||||
// of memory leaks for now but it's working
|
||||
int ignored = 1;
|
||||
|
@ -21,6 +22,7 @@ void UpdateListener::handleFileAction(efsw::WatchID watchid,
|
|||
full_path.end(), '\\', '/');
|
||||
|
||||
int rc = git_ignore_path_is_ignored(&ignored, repo, full_path.c_str());
|
||||
assert(rc == 0 && "libgit2 says it can't check the ignored file");
|
||||
|
||||
if(!ignored) {
|
||||
changes = changes || !ignored;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
[wrap-file]
|
||||
directory = libgit2-1.8.1
|
||||
source_url = https://github.com/libgit2/libgit2/archive/refs/tags/v1.8.1.tar.gz
|
||||
source_filename = v1.8.1.tar.gz
|
||||
source_hash = 8c1eaf0cf07cba0e9021920bfba9502140220786ed5d8a8ec6c7ad9174522f8e
|
||||
directory = libgit2-1.9.0
|
||||
source_url = https://github.com/libgit2/libgit2/archive/refs/tags/v1.9.0.tar.gz
|
||||
source_filename = v1.9.0.tar.gz
|
||||
source_hash = 75b27d4d6df44bd34e2f70663cfd998f5ec41e680e1e593238bbe517a84c7ed2
|
||||
wrapdb_version = 2.4.1-3
|
||||
# patch_filename =
|
||||
# patch_hash =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue