Skip to content

Commit

Permalink
fix msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
benney authored and benney committed Dec 7, 2024
1 parent 146bacd commit 41470a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
15 changes: 1 addition & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# CMakeLists.txt
cmake_minimum_required(VERSION 3.21)
project(fastplong VERSION 0.2.1)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# Find dependencies provided by vcpkg (via vcpkg.cmake)
find_package(hwy CONFIG REQUIRED)
Expand Down Expand Up @@ -132,18 +133,4 @@ target_link_libraries(
-lisal
)
add_test(fastplong_tests fastplong_tests)
function(print_all_variables)
message(STATUS "CMake Variables:")
get_cmake_property(_variableNames VARIABLES)
list(SORT _variableNames)
foreach (_variableName ${_variableNames})
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
message(STATUS "arch=${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}")
message(STATUS "CMAKE_HOST_SYSTEM_PROCESSOR=${CMAKE_HOST_SYSTEM_PROCESSOR}")
endfunction()


print_all_variables()


5 changes: 5 additions & 0 deletions src/sequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ string Sequence::reverseComplement(string *HWY_RESTRICT origin) {
return output;
};
if (length <= 1000000) {
#if _MSC_VER
auto outputPtr = std::make_unique<uint8_t>(length);
uint8_t* output = outputPtr.get();
#else
uint8_t output[length];
#endif
hn::Transform1Reversed(d, output, length, sequence, transform);
auto retVal = reinterpret_cast<char *>(output);
std::string reversed(retVal, length);
Expand Down

0 comments on commit 41470a4

Please sign in to comment.