Skip to content

Commit

Permalink
Fix windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
markkohdev committed Aug 19, 2024
1 parent 4f98c93 commit 1f6c0b1
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 20 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ jobs:
# TODO: Switch back to macos-latest once https://github.com/actions/python-versions/pull/114 is fixed
os:
- 'ubuntu-latest'
# TODO: Fix failing CMake build on windows:
# Error: `cl : command line error D8016: '/O2' and '/RTC1' command-line options are incompatible [D:\a\voyager\voyager\cpp\test\test.vcxproj]`
# I've tried passing CXX flags, but windows doesn't seem to respect disabling runtime checks with /RTC1 or disabling optimizations with /O2
- windows-latest
- macos-12
name: Test C++ on ${{ matrix.os }}
Expand All @@ -66,7 +63,6 @@ jobs:
if: matrix.os == 'windows-latest'
run: |
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
choco install ninja
- name: Install CMake (MacOS)
if: matrix.os == 'macos-12'
run: brew install cmake
Expand Down
12 changes: 0 additions & 12 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@ set(CMAKE_CXX_STANDARD 17)
set(LLVM_CXX_STD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if (MSVC)
# Set /RTC1 only for Debug builds
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /RTC1")

# Ensure /RTC1 is not used in Release builds
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2")

# Optionally, remove /RTC1 from the global CXX flags to avoid conflicts
string(REGEX REPLACE "/RTC1" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif()

enable_testing()

add_subdirectory(include)
Expand All @@ -38,4 +27,3 @@ add_custom_target(format
COMMAND ${FORMAT_COMMAND} `${FIND_COMMAND}`
COMMENT "Running C++ formatter"
)

2 changes: 1 addition & 1 deletion cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build: cmake
cmake --build ${BUILD_DIR}

test: build
cmake --build ${BUILD_DIR} --target test
ctest --test-dir ${BUILD_DIR}

clean:
rm -rf ${BUILD_DIR}/*
1 change: 1 addition & 0 deletions cpp/src/E4M3.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#pragma once

#include <cmath>
#include <string>

static constexpr float ALL_E4M3_VALUES[256] = {
0,
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/Enums.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <string>

/**
* The space (i.e. distance metric) to use for searching.
*/
Expand Down
3 changes: 0 additions & 3 deletions cpp/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ target_link_libraries(VoyagerTests
doctest
)

# Add the tests
add_test(NAME VoyagerTests COMMAND VoyagerTests)

# Discover tests using Doctest
include(${CMAKE_SOURCE_DIR}/include/doctest/scripts/cmake/doctest.cmake)
doctest_discover_tests(VoyagerTests)

0 comments on commit 1f6c0b1

Please sign in to comment.