mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
force include math library for each target
This commit is contained in:
parent
e7b4a8c522
commit
d4f202cbea
@ -46,12 +46,6 @@ if(MSVC)
|
|||||||
add_compile_options(/Za)
|
add_compile_options(/Za)
|
||||||
endif(MSVC)
|
endif(MSVC)
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
|
||||||
link_libraries(m)
|
|
||||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
||||||
link_libraries(m)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_subdirectory(conversions)
|
add_subdirectory(conversions)
|
||||||
add_subdirectory(misc)
|
add_subdirectory(misc)
|
||||||
add_subdirectory(project_euler)
|
add_subdirectory(project_euler)
|
||||||
|
@ -16,7 +16,11 @@ foreach( testsourcefile ${APP_SOURCES} )
|
|||||||
if(OpenMP_C_FOUND)
|
if(OpenMP_C_FOUND)
|
||||||
target_link_libraries(${testname} OpenMP::OpenMP_C)
|
target_link_libraries(${testname} OpenMP::OpenMP_C)
|
||||||
endif()
|
endif()
|
||||||
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
target_link_libraries(${testname} m)
|
target_link_libraries(${testname} m)
|
||||||
|
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
|
target_link_libraries(${testname} m)
|
||||||
|
endif()
|
||||||
|
|
||||||
install(TARGETS ${testname} DESTINATION "bin/conversions")
|
install(TARGETS ${testname} DESTINATION "bin/conversions")
|
||||||
|
|
||||||
|
@ -16,6 +16,11 @@ foreach( testsourcefile ${APP_SOURCES} )
|
|||||||
if(OpenMP_C_FOUND)
|
if(OpenMP_C_FOUND)
|
||||||
target_link_libraries(${testname} OpenMP::OpenMP_C)
|
target_link_libraries(${testname} OpenMP::OpenMP_C)
|
||||||
endif()
|
endif()
|
||||||
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
|
target_link_libraries(${testname} m)
|
||||||
|
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
|
target_link_libraries(${testname} m)
|
||||||
|
endif()
|
||||||
install(TARGETS ${testname} DESTINATION "bin/misc")
|
install(TARGETS ${testname} DESTINATION "bin/misc")
|
||||||
|
|
||||||
endforeach( testsourcefile ${APP_SOURCES} )
|
endforeach( testsourcefile ${APP_SOURCES} )
|
||||||
|
@ -24,7 +24,11 @@ foreach( testsourcefile ${APP_SOURCES} )
|
|||||||
if(OpenMP_C_FOUND)
|
if(OpenMP_C_FOUND)
|
||||||
target_link_libraries(${testname} OpenMP::OpenMP_C)
|
target_link_libraries(${testname} OpenMP::OpenMP_C)
|
||||||
endif()
|
endif()
|
||||||
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
|
target_link_libraries(${testname} m)
|
||||||
|
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
|
target_link_libraries(${testname} m)
|
||||||
|
endif()
|
||||||
install(TARGETS ${testname} DESTINATION "bin/numerical_methods")
|
install(TARGETS ${testname} DESTINATION "bin/numerical_methods")
|
||||||
|
|
||||||
endforeach( testsourcefile ${APP_SOURCES} )
|
endforeach( testsourcefile ${APP_SOURCES} )
|
||||||
|
@ -19,7 +19,11 @@ foreach( testsourcefile ${APP_SOURCES} )
|
|||||||
if(OpenMP_C_FOUND)
|
if(OpenMP_C_FOUND)
|
||||||
target_link_libraries(${testname} OpenMP::OpenMP_C)
|
target_link_libraries(${testname} OpenMP::OpenMP_C)
|
||||||
endif()
|
endif()
|
||||||
set_target_properties(${testname} PROPERTIES LINKER_LANGUAGE C)
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
|
target_link_libraries(${testname} m)
|
||||||
|
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
|
target_link_libraries(${testname} m)
|
||||||
|
endif()
|
||||||
install(TARGETS ${testname} DESTINATION "bin/misc")
|
install(TARGETS ${testname} DESTINATION "bin/misc")
|
||||||
|
|
||||||
endforeach( testsourcefile ${APP_SOURCES} )
|
endforeach( testsourcefile ${APP_SOURCES} )
|
||||||
|
@ -16,6 +16,11 @@ foreach( testsourcefile ${APP_SOURCES} )
|
|||||||
if(OpenMP_C_FOUND)
|
if(OpenMP_C_FOUND)
|
||||||
target_link_libraries(${testname} OpenMP::OpenMP_C)
|
target_link_libraries(${testname} OpenMP::OpenMP_C)
|
||||||
endif()
|
endif()
|
||||||
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
|
target_link_libraries(${testname} m)
|
||||||
|
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
|
target_link_libraries(${testname} m)
|
||||||
|
endif()
|
||||||
install(TARGETS ${testname} DESTINATION "bin/searching")
|
install(TARGETS ${testname} DESTINATION "bin/searching")
|
||||||
|
|
||||||
endforeach( testsourcefile ${APP_SOURCES} )
|
endforeach( testsourcefile ${APP_SOURCES} )
|
||||||
|
@ -16,6 +16,11 @@ foreach( testsourcefile ${APP_SOURCES} )
|
|||||||
if(OpenMP_C_FOUND)
|
if(OpenMP_C_FOUND)
|
||||||
target_link_libraries(${testname} OpenMP::OpenMP_C)
|
target_link_libraries(${testname} OpenMP::OpenMP_C)
|
||||||
endif()
|
endif()
|
||||||
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
|
target_link_libraries(${testname} m)
|
||||||
|
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
|
target_link_libraries(${testname} m)
|
||||||
|
endif()
|
||||||
install(TARGETS ${testname} DESTINATION "bin/sorting")
|
install(TARGETS ${testname} DESTINATION "bin/sorting")
|
||||||
|
|
||||||
endforeach( testsourcefile ${APP_SOURCES} )
|
endforeach( testsourcefile ${APP_SOURCES} )
|
||||||
|
Loading…
Reference in New Issue
Block a user