]> granicus.if.org Git - graphviz/commitdiff
CMake: link -lm globally on Unix instead of fine-grained
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 8 Jun 2022 01:52:45 +0000 (18:52 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 8 Jun 2022 02:11:12 +0000 (19:11 -0700)
It is simpler to express this dependency globally than to try to manage a
dependency on such a fundamental part of the C standard library on a
case-by-case basis.

CMakeLists.txt
cmd/edgepaint/CMakeLists.txt
cmd/gvmap/CMakeLists.txt
cmd/smyrna/CMakeLists.txt
cmd/tools/CMakeLists.txt
lib/glcomp/CMakeLists.txt
lib/gvc/CMakeLists.txt
lib/pathplan/CMakeLists.txt
lib/sparse/CMakeLists.txt
plugin/lasi/CMakeLists.txt

index 0ee5f970d202311c5d1488fb9d2a20e839b3747d..8b18c0d6aff3ce71d198f78b5ec262e7560ecec2 100644 (file)
@@ -129,6 +129,7 @@ endif()
 
 if(UNIX)
   find_library(MATH_LIB m)
+  link_libraries(${MATH_LIB})
 endif()
 
 if(WIN32)
index 82398933f33efede470bcde0c3364ec62af94b27..8b3e464b3b0f23ca62f2dc473963b68c9439534b 100644 (file)
@@ -23,7 +23,6 @@ if(with_sfdp)
     rbtree
     sfdpgen
     sparse
-    ${MATH_LIB}
   )
 
   if(NOT HAVE_GETOPT_H)
index 32c5dfedfb6e2549b4dda7470dadc21f27947fdf..e3d91a1cfcbe12c858ea53ba226e776993ef96df 100644 (file)
@@ -30,7 +30,6 @@ if(with_sfdp)
     rbtree
     sfdpgen
     sparse
-    ${MATH_LIB}
   )
 
   if(NOT HAVE_GETOPT_H)
index 6621bea4b86ecf0371eb7411818130f9eb73b2aa..1b7597b25ed7533ad63267c0d56332a7769dd676 100644 (file)
@@ -116,7 +116,6 @@ if(with_smyrna)
     ${GTK2_LIBRARIES}
     ${GTKGLEXT_LIBRARIES}
     ${GTS_LIBRARIES}
-    ${MATH_LIB}
     ${XRENDER_LIBRARIES}
   )
 
index 1fc244f27cbe70eee91f70c0359cd8568eba26bd..39a4930f2f68e78c13de3c51a2b36d9272c5989a 100644 (file)
@@ -231,7 +231,6 @@ target_include_directories(gvcolor SYSTEM PRIVATE
 target_link_libraries(gvcolor
   cgraph
   ingraphs
-  ${MATH_LIB}
 )
 
 tool_defaults(gvcolor)
@@ -261,11 +260,6 @@ target_include_directories(gvgen SYSTEM PRIVATE
 
 target_link_libraries(gvgen cgraph)
 
-# Link to math library
-if(UNIX)
-  target_link_libraries(gvgen ${MATH_LIB})
-endif()
-
 tool_defaults(gvgen)
 
 # =================================== gvpack ===================================
index e11b9d9c1f1d72911bda6514bdec452c98d8f9a0..1ca6396749cf511119a36f4f21b1834640d9099f 100644 (file)
@@ -52,7 +52,6 @@ if(with_smyrna)
     ${Freetype_LIBRARIES}
     ${GLUT_LIBRARIES}
     ${GTK2_LIBRARIES}
-    ${MATH_LIB}
     ${PANGOCAIRO_LIBRARIES}
     ${XRENDER_LIBRARIES}
   )
index 81bdeb195bba642b86389079202d1e3a4d8c7351..b437bde8c8a734f401ef4b2ec7dc58a069b49610 100644 (file)
@@ -64,10 +64,6 @@ target_link_libraries(gvc PRIVATE
   pack
 )
 
-target_link_libraries(gvc PUBLIC
-  ${MATH_LIB}
-)
-
 if(LTDL_FOUND)
   target_include_directories(gvc SYSTEM PRIVATE ${LTDL_INCLUDE_DIRS})
   if(NOT WIN32 OR MINGW)
index 592c58e26247fdd71bde47a654d69c7c6b7f5545..641296dfd75dc7e1e448569f74e9bcccfc67ae22 100644 (file)
@@ -67,7 +67,3 @@ set_target_properties(pathplan PROPERTIES
   VERSION 4.0.0
   SOVERSION 4
 )
-target_link_libraries(
-  pathplan
-  ${MATH_LIB}
-)
index d619d49d18276fec8971ba999931cf91571d9031..94293f032aac27d4fcba2b7ddca88b47bb0ca413 100644 (file)
@@ -32,7 +32,3 @@ target_include_directories(sparse PRIVATE
   ../cgraph
   ../common
 )
-
-target_link_libraries(sparse
-  ${MATH_LIB}
-)
index 2655b3615185102b6e7502e67b02173a524aa3e8..f7f20d6aaf16c82865d61e17101c90607ceb8e3d 100644 (file)
@@ -31,7 +31,6 @@ if(Freetype_FOUND AND LASI_FOUND AND PANGOCAIRO_FOUND)
   target_link_libraries(gvplugin_lasi
     ${Freetype_LIBRARIES}
     ${LASI_LIBRARIES}
-    ${MATH_LIB}
     ${PANGOCAIRO_LIBRARIES}
   )