• R/O
  • SSH

libctools: Commit

This library contains code that extends and simplifies different operations
for C language based programs.


Commit MetaInfo

Revisión09e9b140d9a99e740c668daf6e1da5b1f4e2c494 (tree)
Tiempo2017-10-09 07:39:31
Autors.gusarov
Commiters.gusarov

Log Message

Link tests with libm when compiled with gcc and analogs

Cambiar Resumen

Diferencia incremental

diff -r d4610552c8de -r 09e9b140d9a9 CMakeLists.txt
--- a/CMakeLists.txt Mon Oct 09 00:58:08 2017 +0300
+++ b/CMakeLists.txt Mon Oct 09 01:39:31 2017 +0300
@@ -122,6 +122,20 @@
122122 set(CMAKE_VERBOSE_MAKEFILE true)
123123
124124 if (CT_BUILD_TESTS)
125+ # Dependency on libm is optional for external projects.
126+ # Only projects which include std/math.h should be linked against libm.
127+
128+ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
129+ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_tools/tools/link_public.cmake)
130+ target_link_libraries(${PROJECT_NAME} ${CMT_LINK_PUBLIC} m)
131+ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
132+ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_tools/tools/link_public.cmake)
133+ target_link_libraries(${PROJECT_NAME} ${CMT_LINK_PUBLIC} m)
134+ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel")
135+ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_tools/tools/link_public.cmake)
136+ target_link_libraries(${PROJECT_NAME} ${CMT_LINK_PUBLIC} m)
137+ endif()
138+
125139 cmtAssertVariableNotEmpty(CT_TESTS_BIN_DIR)
126140 add_subdirectory(tests)
127141 endif()
Show on old repository browser