Skip to content

Commit

Permalink
Merge pull request #140 from dmeybohm/move-files
Browse files Browse the repository at this point in the history
Reorganize includes
  • Loading branch information
dmeybohm authored Oct 14, 2024
2 parents d87d467 + 0b5683a commit c13702e
Show file tree
Hide file tree
Showing 259 changed files with 196 additions and 200 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,33 +93,33 @@ jobs:

- name: Fast Tests (Ubuntu)
if: matrix.os == 'ubuntu-latest'
working-directory: ${{ github.workspace }}/build/engine/test
run: ${{ github.workspace }}/build/engine/test/fast_tests
working-directory: ${{ github.workspace }}/build/src/wisdom-chess/engine/test
run: ${{ github.workspace }}/build/src/wisdom-chess/engine/test/fast_tests

- name: Slow Tests (Ubuntu)
if: matrix.os == 'ubuntu-latest'
working-directory: ${{ github.workspace }}/build/engine/test
run: ${{ github.workspace }}/build/engine/test/slow_tests
working-directory: ${{ github.workspace }}/build/src/wisdom-chess/engine/test
run: ${{ github.workspace }}/build/src/wisdom-chess/engine/test/slow_tests

- name: Fast Tests (macOS)
if: matrix.os == 'macos-latest'
working-directory: ${{ github.workspace }}/build/engine/test
run: ${{ github.workspace }}/build/engine/test/fast_tests
working-directory: ${{ github.workspace }}/build/src/wisdom-chess/engine/test
run: ${{ github.workspace }}/build/src/wisdom-chess/engine/test/fast_tests

- name: Slow Tests (macOS)
if: matrix.os == 'macos-latest'
working-directory: ${{ github.workspace }}/build/engine/test
run: ${{ github.workspace }}/build/engine/test/slow_tests
working-directory: ${{ github.workspace }}/build/src/wisdom-chess/engine/test
run: ${{ github.workspace }}/build/src/wisdom-chess/engine/test/slow_tests

- name: Fast Tests (Windows)
if: matrix.os == 'windows-2019' || matrix.os == 'windows-latest'
working-directory: ${{ github.workspace }}/build/engine/test/${{ matrix.build_type }}
run: ${{ github.workspace }}/build/engine/test/${{ matrix.build_type }}/fast_tests.exe
working-directory: ${{ github.workspace }}/build/src/wisdom-chess/engine/test/${{ matrix.build_type }}
run: ${{ github.workspace }}/build/src/wisdom-chess/engine/test/${{ matrix.build_type }}/fast_tests.exe

- name: Slow Tests (Windows)
if: matrix.os == 'windows-2019' || matrix.os == 'windows-latest'
working-directory: ${{ github.workspace }}/build/engine/test//${{ matrix.build_type }}
run: ${{ github.workspace }}/build/engine/test/${{ matrix.build_type }}/slow_tests.exe
working-directory: ${{ github.workspace }}/build/src/wisdom-chess/engine/test//${{ matrix.build_type }}
run: ${{ github.workspace }}/build/src/wisdom-chess/engine/test/${{ matrix.build_type }}/slow_tests.exe

- name: Install (CMake)
run: >
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,28 @@ jobs:
run: cmake --build ${{ github.workspace }}/build --config Release -j 4

- name: Install Front-end Dependencies
working-directory: ${{ github.workspace }}/ui/react
working-directory: ${{ github.workspace }}/src/wisdom-chess/ui/react
run: npm ci

- name: Build Front-end
working-directory: ${{ github.workspace }}/ui/react
working-directory: ${{ github.workspace }}/src/wisdom-chess/ui/react
run: npm run build

- name: Install Netlify CLI
working-directory: ${{ github.workspace }}/ui/react
working-directory: ${{ github.workspace }}/src/wisdom-chess/ui/react
run: npm install -g netlify-cli

- name: Deploy Preview
if: github.event.pull_request.merged != true && github.actor != 'dependabot[bot]'
working-directory: ${{ github.workspace }}/ui/react
working-directory: ${{ github.workspace }}/src/wisdom-chess/ui/react
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
run: netlify deploy --dir dist

- name: Deploy Production
if: github.event.pull_request.merged == true && github.base_ref == 'main'
working-directory: ${{ github.workspace }}/ui/react
working-directory: ${{ github.workspace }}/src/wisdom-chess/ui/react
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
Expand Down
14 changes: 7 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ cmake-build-*
.vs
.vscode
CMakeLists.txt.user
/ui/react/public/wisdom-chess-web.wasm
/ui/react/public/wisdom-chess-web.js
/ui/react/public/wisdom-chess-web.ww.js
/ui/react/public/wisdom-chess-load.js
/ui/react/public/glue.js
/ui/react/dist/
/ui/react/dev-dist/
/src/wisdom-chess/ui/react/public/wisdom-chess-web.wasm
/src/wisdom-chess/ui/react/public/wisdom-chess-web.js
/src/wisdom-chess/ui/react/public/wisdom-chess-web.ww.js
/src/wisdom-chess/ui/react/public/wisdom-chess-load.js
/src/wisdom-chess/ui/react/public/glue.js
/src/wisdom-chess/ui/react/dist/
/src/wisdom-chess/ui/react/dev-dist/

# Local Netlify folder
.netlify
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,5 @@ if (WISDOM_CHESS_ASAN)
endif()
endif()

add_subdirectory(engine)
add_subdirectory(ui)
add_subdirectory(src)

41 changes: 0 additions & 41 deletions engine/CMakeLists.txt

This file was deleted.

68 changes: 0 additions & 68 deletions engine/src/CMakeLists.txt

This file was deleted.

1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(wisdom-chess)
2 changes: 2 additions & 0 deletions src/wisdom-chess/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
add_subdirectory(engine)
add_subdirectory(ui)
File renamed without changes.
File renamed without changes.
105 changes: 105 additions & 0 deletions src/wisdom-chess/engine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

cmake_minimum_required(VERSION 3.20)

project(WisdomEngine CXX)

find_package(Threads REQUIRED)

CPMAddPackage("gh:foonathan/type_safe@0.2.3")
CPMAddPackage("gh:microsoft/GSL@4.0.0")
CPMAddPackage(
NAME doctest
GITHUB_REPOSITORY doctest/doctest
GIT_TAG v2.4.11
OPTIONS
"DOCTEST_NO_INSTALL On"
)

find_package(doctest)

if (ANDROID OR NOT WISDOM_CHESS_PCH_ENABLED)
# Disable precompile headers because there is a confict on android where it links
# some code as PIC and some as non-PIC and can't combine them.
set(PCH_ENABLED OFF)
message("-- wisdom-chess: precompiled headers disabled")
else()
set(PCH_ENABLED ON)
message("-- wisdom-chess: precompiled headers enabled")
endif()

add_library(wisdom-chess-core STATIC
board_builder.hpp
board_code.hpp
board.hpp
coord.hpp
evaluate.hpp
fen_parser.hpp
game.hpp
game_status.hpp
generate.hpp
global.hpp
history.hpp
logger.hpp
material.hpp
move.hpp
move_list.hpp
move_timer.hpp
output_format.hpp
piece.hpp
position.hpp
random.hpp
search.hpp
str.hpp
threats.hpp
board.cpp
board_code.cpp
coord.cpp
evaluate.cpp
fen_parser.cpp
game.cpp
game_status.cpp
generate.cpp
history.cpp
logger.cpp
material.cpp
move.cpp
move_list.cpp
move_timer.cpp
output_format.cpp
piece.cpp
position.cpp
search.cpp
str.cpp)

if (PCH_ENABLED)
target_precompile_headers(wisdom-chess-core PRIVATE PRIVATE global.hpp)
else()
target_sources(wisdom-chess-core PRIVATE global.hpp)
endif()

target_include_directories(wisdom-chess-core PUBLIC ../..)
add_library(wisdom::chess ALIAS wisdom-chess-core)

target_link_libraries(wisdom-chess-core PUBLIC Microsoft.GSL::GSL)
target_link_libraries(wisdom-chess-core PUBLIC Threads::Threads)
target_link_libraries(wisdom-chess-core PUBLIC type_safe)

if (EMSCRIPTEN)
target_compile_options(wisdom-chess-core PUBLIC -pthread)
endif()

if (NOT WIN32 AND NOT EMSCRIPTEN)
message("-- wisdom-chess: stack protector disabled for performance")
target_compile_options(wisdom-chess-core PUBLIC -fno-stack-protector)
endif()

if (doctest_FOUND)
message("-- wisdom-chess: Including tests with doctest")
add_subdirectory(test)
else()
message("-- wisdom-chess: Tests disabled (doctest not found)")
set(WISDOM_CHESS_SLOW_TESTS Off)
set(WISDOM_CHESS_FAST_TESTS Off)
endif()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ if (WISDOM_CHESS_FAST_TESTS)
game_test.cpp
test_main.cpp)

target_precompile_headers(fast_tests PRIVATE PRIVATE
../../include/wisdom-chess/engine/global.hpp)
target_precompile_headers(fast_tests PRIVATE PRIVATE ../global.hpp)

target_link_libraries(fast_tests PRIVATE wisdom::chess)
target_link_libraries(fast_tests PRIVATE doctest::doctest)
Expand All @@ -39,8 +38,7 @@ if (WISDOM_CHESS_SLOW_TESTS)
move_perft_test.cpp
test_main.cpp)

target_precompile_headers(slow_tests PRIVATE PRIVATE
../../include/wisdom-chess/engine/global.hpp)
target_precompile_headers(slow_tests PRIVATE PRIVATE ../global.hpp)

target_link_libraries(slow_tests PRIVATE wisdom::chess)
target_link_libraries(slow_tests PRIVATE doctest::doctest)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions ui/qml/CMakeLists.txt → src/wisdom-chess/ui/qml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ endif ()

qt_add_executable(WisdomChessQml
main/main.cpp
include/wisdom-chess/qml/game_model.hpp
main/game_model.hpp
main/game_model.cpp
include/wisdom-chess/qml/pieces_model.hpp
main/pieces_model.hpp
main/pieces_model.cpp
include/wisdom-chess/qml/chess_game.hpp
main/chess_game.hpp
main/chess_game.cpp
include/wisdom-chess/qml/chess_engine.hpp
main/chess_engine.hpp
main/chess_engine.cpp
main/ui_types.cpp
include/wisdom-chess/qml/ui_types.hpp
include/wisdom-chess/qml/ui_settings.hpp
main/ui_types.hpp
main/ui_settings.hpp
main/ui_settings.cpp
include/wisdom-chess/qml/game_settings.hpp
main/game_settings.hpp
main/game_settings.cpp
${app_icon_resource_windows}
${app_icon_macos}
Expand Down Expand Up @@ -133,7 +133,7 @@ target_link_libraries(WisdomChessQml
target_compile_definitions(WisdomChessQml
PRIVATE MAIN_QML_FILE="${MAIN_QML_FILE}")

target_include_directories(WisdomChessQml PRIVATE include)
target_include_directories(WisdomChessQml PRIVATE ../../..)

install(TARGETS WisdomChessQml
BUNDLE DESTINATION "/Applications"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "wisdom-chess/engine/evaluate.hpp"
#include "wisdom-chess/engine/logger.hpp"

#include "wisdom-chess/qml/chess_engine.hpp"
#include "wisdom-chess/ui/qml/main/chess_engine.hpp"

using namespace wisdom;
using gsl::not_null;
Expand Down
Loading

0 comments on commit c13702e

Please sign in to comment.