Fixes for MSVC

This commit is contained in:
Carles Fernandez 2019-11-25 21:48:52 +01:00
parent 6993890587
commit bc7edede7c
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
5 changed files with 13 additions and 5 deletions

View File

@ -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})

View File

@ -45,6 +45,9 @@
#ifdef __cplusplus
#ifdef _MSC_VER
#include <complex.h>
#endif
#include <complex>
#include <stdint.h>

View File

@ -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;

View File

@ -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 $<INSTALL_INTERFACE:include>
PRIVATE ${PROJECT_SOURCE_DIR}/kernels
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
)
endif()

View File

@ -59,6 +59,7 @@ static inline unsigned long long _xgetbv(unsigned int index)
#elif defined(_MSC_VER) && defined(HAVE_INTRIN_H)
#include <intrin.h>
#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)