fix cmake - requires use of /Za on MSVC

This commit is contained in:
Krishna Vedala 2020-05-29 12:34:24 -04:00
parent e0f8620db6
commit 8f45f7e680
2 changed files with 4 additions and 5 deletions

View File

@ -38,12 +38,12 @@ set(DOXYGEN_GENERATE_MAN NO)
)
endif()
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED YES)
if(MSVC)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
# add_compile_options(/Za)
add_compile_options(/Za)
endif(MSVC)
add_subdirectory(conversions)

View File

@ -11,7 +11,7 @@ file( GLOB APP_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.c )
set (no_msvc "newton-raphson-root.c" "durand_kerner_roots.c")
foreach( testsourcefile ${APP_SOURCES} )
# I used a simple string replace, to cut off .cpp.
# Do not compile these files that use complex.h on MSVC
if ( ${testsourcefile} IN_LIST no_msvc AND MSVC)
continue()
endif()
@ -20,7 +20,6 @@ foreach( testsourcefile ${APP_SOURCES} )
string( REPLACE " " "_" testname ${testname} )
add_executable( ${testname} ${testsourcefile} )
set_target_properties( ${testname} PROPERTIES LINKER_LANGUAGE C)
if(OpenMP_C_FOUND)
target_link_libraries(${testname} OpenMP::OpenMP_C)