Fix CMakeLists.txt, add help to perft
Diffstat:
2 files changed, 15 insertions(+), 3 deletions(-)
@@ -4,9 +4,9 @@
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(
Stellar
VERSION 0.0.35
DESCRIPTION "Chess engine written in C"
DESCRIPTION "Chess engine written in C++"
HOMEPAGE_URL https://git.dimitrijedobrota.com/stellar.git
LANGUAGES C CXX
LANGUAGES CXX
)
enable_testing()
@@ -121,11 +121,19 @@
void perft_test(const char *fen, int depth, int thread_num) {
#endif
}
void usage(const char *program) {
std::cout << "Usage: " << program;
std::cout << " [-h]";
std::cout << " [-t thread number]";
std::cout << " [-d depth]";
std::cout << " [-f fen]" <<std::endl;
}
int main(int argc, char *argv[]) {
int c, depth = 1, thread_num = 1;
std::string s(start_position);
const char *fen = s.data();
while ((c = getopt(argc, argv, "t:f:d:")) != -1) {
while ((c = getopt(argc, argv, "ht:f:d:")) != -1) {
switch (c) {
case 't':
thread_num = atoi(optarg);
@@ -138,7 +146,11 @@
int main(int argc, char *argv[]) {
depth = atoi(optarg);
if (depth <= 0) abort();
break;
case 'h':
usage(argv[0]);
return 1;
default:
usage(argv[0]);
abort();
}
}