diff --git a/CMakeLists.txt b/CMakeLists.txt index 08903be66..466503637 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/numerical_methods/CMakeLists.txt b/numerical_methods/CMakeLists.txt index b3f2fa3ab..16757ce14 100644 --- a/numerical_methods/CMakeLists.txt +++ b/numerical_methods/CMakeLists.txt @@ -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)