tuning win build

This commit is contained in:
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}