tuning win build
fsfw/fsfw/pipeline/head This commit looks good Details

This commit is contained in:
Ulrich Mohr 2023-01-27 16:41:04 +01:00
parent bc312243df
commit 45963b2064
3 changed files with 29 additions and 5 deletions

View File

@ -64,6 +64,11 @@ elseif(${CMAKE_CXX_STANDARD} LESS 17)
"${MSG_PREFIX} Compiling the FSFW requires a minimum of C++17 support")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# Manually tweak MSVC to emit (about) the same warnings as clang and gcc on linux
add_compile_options("/permissive-" /wd4267 /wd4244 /wd4244 /wd4305 /wd4805 /wd4267 /wd4646 /wd4065 "/Dand=&&" "/Dor=||" "/Dnot=!")
endif()
set(FSFW_SOURCES_DIR "${CMAKE_SOURCE_DIR}/src/fsfw")
set(FSFW_ETL_LIB_NAME etl)
@ -476,11 +481,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(FSFW_WARNING_FLAGS -Weverything -Wno-gnu-anonymous-struct)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(COMPILER_FLAGS "/permissive-" "/Wall")
add_compile_definitions(NOMINMAX not=! and=&& or=||)
endif()
# Required include paths to compile the FSFW
target_include_directories(
${LIB_FSFW_NAME} INTERFACE ${CMAKE_SOURCE_DIR} ${FSFW_CONFIG_PATH_ABSOLUTE}

View File

@ -52,6 +52,7 @@ ReturnValue_t DleParser::parseRingBuf(size_t& readSize) {
// without skipping the STX
readSize = vectorIdx;
ErrorInfo info;
info.len = vectorIdx;
setErrorContext(ErrorTypes::CONSECUTIVE_STX_CHARS, info);
return POSSIBLE_PACKET_LOSS;
}

View File

@ -0,0 +1,23 @@
set(CMAKE_SYSTEM_NAME Windows)
# which compilers to use for C and C++
set(CMAKE_C_COMPILER /opt/msvc/bin/x64/cl)
set(CMAKE_CXX_COMPILER /opt/msvc/bin/x64/cl)
# built in tests fail
set(CMAKE_C_COMPILER_WORKS 1)
set(CMAKE_CXX_COMPILER_WORKS 1)
# adjust the default behavior of the FIND_XXX() commands:
# search programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
# search headers and libraries in the target environment
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
# ignore host installed libraries
# makes find_package() ignore the <package>Config.cmake files
set(CMAKE_IGNORE_PATH /usr/local)