mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 10:57:43 +00:00
Changed to set the binary directory to the current working directory.
This commit is contained in:
@@ -20,6 +20,15 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <filesystem>
|
||||||
|
|
||||||
|
#ifndef NOMINMAX
|
||||||
|
#define NOMINMAX
|
||||||
|
#endif
|
||||||
|
#include <Windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "bitboard.h"
|
#include "bitboard.h"
|
||||||
#include "endgame.h"
|
#include "endgame.h"
|
||||||
#include "position.h"
|
#include "position.h"
|
||||||
@@ -34,6 +43,17 @@ namespace PSQT {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
|
// Change the current working directory to the binary directory. So that a
|
||||||
|
// net file path can be specified with a relative path from the binary
|
||||||
|
// directory.
|
||||||
|
// TODO(someone): Implement the logic for other OS.
|
||||||
|
#ifdef _WIN32
|
||||||
|
TCHAR filename[_MAX_PATH];
|
||||||
|
::GetModuleFileName(NULL, filename, sizeof(filename) / sizeof(filename[0]));
|
||||||
|
std::filesystem::path current_path = filename;
|
||||||
|
current_path.remove_filename();
|
||||||
|
std::filesystem::current_path(current_path);
|
||||||
|
#endif
|
||||||
|
|
||||||
std::cout << engine_info() << std::endl;
|
std::cout << engine_info() << std::endl;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user