mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
fix cmake - requires use of /Za on MSVC
This commit is contained in:
parent
e0f8620db6
commit
8f45f7e680
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user