Skip to content

Instantly share code, notes, and snippets.

@gekomad
Created June 11, 2025 08:47
Show Gist options
  • Save gekomad/db922403aba1271810ab80af85112023 to your computer and use it in GitHub Desktop.
Save gekomad/db922403aba1271810ab80af85112023 to your computer and use it in GitHub Desktop.
Cmake file for Crafty Chess Engine
cmake_minimum_required(VERSION 3.10)
project(crafty C)
if(NOT CMAKE_C_COMPILER)
set(CMAKE_C_COMPILER clang)
endif()
set(CUSTOM_OPTS "-DELO -DUNIX -DSYZYGY -DCPUS=12" CACHE STRING "Custom compiler definitions")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -DUNIX -Wno-array-bounds -pipe -g -mpopcnt")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lstdc++ -lm")
add_definitions(${CUSTOM_OPTS})
set(SOURCES crafty.c)
add_executable(crafty ${SOURCES})
target_include_directories(crafty PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "crafty;*.o;*.gcda;log.*;game.*;prof")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment