diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index d56b3ac..d2605c9 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -50,12 +50,22 @@ jobs: run: echo "dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - name: Configure CMake - run: > - cmake -B ${{ steps.vars.outputs.dir }} - -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} - -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - -S ${{ github.workspace }} + shell: bash + run: | + CXX_FLAGS="" + LINK_FLAGS="" + if [[ "${{ matrix.os }}" == "ubuntu-latest" && "${{ matrix.build_type }}" == "Debug" ]]; then + CXX_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer -g" + LINK_FLAGS="-fsanitize=address,undefined" + fi + + cmake -B "${{ steps.vars.outputs.dir }}" \ + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \ + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \ + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ + -DCMAKE_CXX_FLAGS_DEBUG="$CXX_FLAGS" \ + -DCMAKE_EXE_LINKER_FLAGS="$LINK_FLAGS" \ + -S "${{ github.workspace }}" - name: Build run: cmake --build ${{ steps.vars.outputs.dir }} --config ${{ matrix.build_type }} @@ -68,4 +78,4 @@ jobs: ctest --build-config ${{ matrix.build_type }} --verbose else ctest --verbose - fi \ No newline at end of file + fi diff --git a/position.h b/position.h index 9f6f01f..01684f1 100644 --- a/position.h +++ b/position.h @@ -149,7 +149,7 @@ template class HeapAllocatedValueList { }; enum class MoveGenType : uint8_t { ALL, PAWN, KNIGHT, BISHOP, ROOK, QUEEN, KING, CAPTURE }; -template || std::is_same_v || std::is_same_v>> class _Position { +template ::value>> class _Position { private: HistoryEntry current_state; @@ -524,6 +524,8 @@ template bool is_valid() const; private: