diff --git a/.gitignore b/.gitignore index 96a025531..bcecf5706 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,6 @@ cmake-build-debug/ /install .DS_Store .pydevproject +.vscode/ +.vs/ +Testing/ diff --git a/cmake/Modules/FindFILESYSTEM.cmake b/cmake/Modules/FindFILESYSTEM.cmake index a670d0fde..6eb6deeec 100644 --- a/cmake/Modules/FindFILESYSTEM.cmake +++ b/cmake/Modules/FindFILESYSTEM.cmake @@ -140,6 +140,9 @@ endif() if((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11")) set(CMAKE_REQUIRED_FLAGS "-std=c++17") endif() +if(MSVC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "18")) + set(CMAKE_REQUIRED_FLAGS "/std:c++17") +endif() # Normalize and check the component list we were given set(want_components ${FILESYSTEM_FIND_COMPONENTS}) diff --git a/docs/changelog b/docs/changelog index 308ad41c5..e6a522d52 100644 --- a/docs/changelog +++ b/docs/changelog @@ -49,6 +49,7 @@ - Fixed building in some ARM-based devices. Now Clang and ARMClang can be used for native building. - Added toolchain files for building gnss-sdr and the volk_gnsssdr library in several ARM processor architectures, including those in Raspberry Pi 3 and 4. - The software can now be built using Xcode (passing -GXcode to CMake) without previous manual installation of volk_gnsssdr. +- Now the volk_gnsssdr library can be built on Microsoft Windows. ### Improvements in Reliability: diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.h index 82a123925..f4959b10f 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.h @@ -27,7 +27,6 @@ * ------------------------------------------------------------------------- */ -#include // for bool #include // for ofstream #include // for string #include // for vector diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindFILESYSTEM.cmake b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindFILESYSTEM.cmake index 7bc06a9b1..3eff98fff 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindFILESYSTEM.cmake +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/FindFILESYSTEM.cmake @@ -139,6 +139,9 @@ endif() if((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11")) set(CMAKE_REQUIRED_FLAGS "-std=c++17") endif() +if(MSVC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "18")) + set(CMAKE_REQUIRED_FLAGS "/std:c++17") +endif() # Normalize and check the component list we were given set(want_components ${FILESYSTEM_FIND_COMPONENTS}) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_complex.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_complex.h index 38ce9b033..65fb6bd37 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_complex.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include/volk_gnsssdr/volk_gnsssdr_complex.h @@ -45,6 +45,9 @@ #ifdef __cplusplus +#ifdef _MSC_VER +#include +#endif #include #include diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h index 6b732c3b6..d3cbe5d85 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/kernels/volk_gnsssdr/volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn.h @@ -103,7 +103,7 @@ static inline void volk_gnsssdr_32fc_32f_high_dynamic_rotator_dot_prod_32fc_xn_g } tmp32_1 = *in_common++ * (*phase); phase_doppler *= phase_inc; - phase_doppler_rate = cpowf(phase_inc_rate, lv_cmake(n * n, 0.0f)); + phase_doppler_rate = cpowf(phase_inc_rate, lv_cmake((float)(n * n), 0.0f)); phase_doppler_rate /= hypotf(lv_creal(phase_doppler_rate), lv_cimag(phase_doppler_rate)); (*phase) = phase_doppler * phase_doppler_rate; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt index 8aa034e00..5c3b6f5d8 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt @@ -80,7 +80,7 @@ if(HAVE_POSIX_MEMALIGN) add_definitions(-DHAVE_POSIX_MEMALIGN) endif() -if(NOT DEFINED _XOPEN_SOURCE) +if(NOT DEFINED _XOPEN_SOURCE AND NOT MSVC) add_definitions(-D_XOPEN_SOURCE=700) endif() @@ -213,7 +213,7 @@ if(CPU_IS_x86) endif() # Disable SSE4a if Clang is less than version 3.2 - if("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") + if(CMAKE_C_COMPILER_ID MATCHES "Clang") # Figure out the version of Clang if(CMAKE_VERSION VERSION_LESS "2.8.10") # Extract the Clang version from the --version string. @@ -564,7 +564,8 @@ list(APPEND volk_gnsssdr_sources set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr.c ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_machines.c -PROPERTIES COMPILE_DEFINITIONS "${machine_defs}") + PROPERTIES COMPILE_DEFINITIONS "${machine_defs}" +) if(MSVC) #add compatibility includes for stdint types @@ -583,7 +584,7 @@ if(NOT (CMAKE_GENERATOR STREQUAL Xcode)) PUBLIC $ PRIVATE ${PROJECT_SOURCE_DIR}/kernels PRIVATE ${CMAKE_CURRENT_BINARY_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ) endif() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h index 2c734f3f7..458deba7f 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.h @@ -25,7 +25,6 @@ #include "volk_gnsssdr/volk_gnsssdr.h" // for volk_gnsssdr_func_desc_t #include "volk_gnsssdr/volk_gnsssdr_complex.h" // for lv_32fc_t -#include // for bool, false #include // for NULL #include // for map #include // for string, basic_string diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc index a67e05ded..4309d2f43 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/testqa.cc @@ -21,7 +21,6 @@ #include "kernel_tests.h" // for init_test_list #include "qa_utils.h" // for volk_gnsssdr_test_case_t, volk_gnsssdr_test_results_t #include "volk_gnsssdr/volk_gnsssdr_complex.h" // for lv_32fc_t -#include // for bool, false, true #include // IWYU pragma: keep #include // for operator<<, basic_ostream, endl, char... #include // for map, map<>::iterator, _Rb_tree_iterator diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c index 808013fd5..782661319 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c @@ -59,6 +59,7 @@ static inline unsigned long long _xgetbv(unsigned int index) #elif defined(_MSC_VER) && defined(HAVE_INTRIN_H) #include #define cpuid_x86(op, r) __cpuid(((int *)r), op) +#define cpuid_x86_count(op, count, regs) __cpuidex((int *)regs, op, count) #if defined(_XCR_XFEATURE_ENABLED_MASK) #define __xgetbv() _xgetbv(_XCR_XFEATURE_ENABLED_MASK)