From aab972c0d52cc6caf5e2887fa0fe0ddbc03ab47c Mon Sep 17 00:00:00 2001 From: Willem Jan Withagen Date: Sat, 16 Jul 2016 14:08:45 +0200 Subject: [PATCH] Cmake: fix using CMAKE_DL_LIBS instead of dl Signed-off-by: Willem Jan Withagen --- src/CMakeLists.txt | 6 +++--- src/erasure-code/CMakeLists.txt | 2 +- src/test/erasure-code/CMakeLists.txt | 26 +++++++++++++------------- src/test/osd/CMakeLists.txt | 4 ++-- src/tracing/CMakeLists.txt | 2 +- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b807cb4f2e3..7257ca9ce02 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -197,7 +197,7 @@ else(INTEL_SSE4_1) endif(INTEL_SSE4_1) -set(EXTRALIBS uuid rt dl ${ATOMIC_OPS_LIBRARIES}) +set(EXTRALIBS uuid rt ${CMAKE_DL_LIBS} ${ATOMIC_OPS_LIBRARIES}) if(${WITH_PROFILER}) list(APPEND EXTRALIBS profiler) @@ -615,7 +615,7 @@ add_executable(ceph-objectstore-tool tools/ceph_objectstore_tool.cc tools/RadosDump.cc $) -target_link_libraries(ceph-objectstore-tool osd os global ${Boost_PROGRAM_OPTIONS_LIBRARY} fuse dl) +target_link_libraries(ceph-objectstore-tool osd os global ${Boost_PROGRAM_OPTIONS_LIBRARY} fuse ${CMAKE_DL_LIBS}) install(TARGETS ceph-objectstore-tool DESTINATION bin) @@ -945,7 +945,7 @@ add_library(osd STATIC ${osd_srcs} $ $ $) -target_link_libraries(osd dl leveldb ${ALLOC_LIBS}) +target_link_libraries(osd ${CMAKE_DL_LIBS} leveldb ${ALLOC_LIBS}) if(WITH_LTTNG) add_dependencies(osd osd-tp) endif() diff --git a/src/erasure-code/CMakeLists.txt b/src/erasure-code/CMakeLists.txt index 940bc2662fc..a0a096f565d 100644 --- a/src/erasure-code/CMakeLists.txt +++ b/src/erasure-code/CMakeLists.txt @@ -16,7 +16,7 @@ if (HAVE_BETTER_YASM_ELF64) endif (HAVE_BETTER_YASM_ELF64) add_library(erasure_code STATIC ErasureCodePlugin.cc) -target_link_libraries(erasure_code dl) +target_link_libraries(erasure_code ${CMAKE_DL_LIBS}) add_dependencies(erasure_code ${CMAKE_SOURCE_DIR}/src/ceph_ver.h) add_library(erasure_code_objs OBJECT ErasureCode.cc) diff --git a/src/test/erasure-code/CMakeLists.txt b/src/test/erasure-code/CMakeLists.txt index afebc1f193e..1fd38dca7c2 100644 --- a/src/test/erasure-code/CMakeLists.txt +++ b/src/test/erasure-code/CMakeLists.txt @@ -2,15 +2,15 @@ add_executable(ceph_erasure_code_benchmark ${CMAKE_SOURCE_DIR}/src/erasure-code/ErasureCode.cc ceph_erasure_code_benchmark.cc) -target_link_libraries(ceph_erasure_code_benchmark osd common ${Boost_PROGRAM_OPTIONS_LIBRARY} global dl) +target_link_libraries(ceph_erasure_code_benchmark osd common ${Boost_PROGRAM_OPTIONS_LIBRARY} global ${CMAKE_DL_LIBS}) install(TARGETS ceph_erasure_code_benchmark DESTINATION bin) add_executable(ceph_erasure_code_non_regression ceph_erasure_code_non_regression.cc) -target_link_libraries(ceph_erasure_code_non_regression osd common ${Boost_PROGRAM_OPTIONS_LIBRARY} global dl) +target_link_libraries(ceph_erasure_code_non_regression osd common ${Boost_PROGRAM_OPTIONS_LIBRARY} global ${CMAKE_DL_LIBS}) add_executable(ceph_erasure_code ceph_erasure_code.cc) -target_link_libraries(ceph_erasure_code osd common ${Boost_PROGRAM_OPTIONS_LIBRARY} global dl) +target_link_libraries(ceph_erasure_code osd common ${Boost_PROGRAM_OPTIONS_LIBRARY} global ${CMAKE_DL_LIBS}) install(TARGETS ceph_erasure_code DESTINATION bin) @@ -49,7 +49,7 @@ add_ceph_unittest(unittest_erasure_code_plugin ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} target_link_libraries(unittest_erasure_code_plugin global osd - dl + ${CMAKE_DL_LIBS} ec_example common ) @@ -136,7 +136,7 @@ target_link_libraries(unittest_erasure_code_plugin_isa common ec_isa crush - dl + ${CMAKE_DL_LIBS} erasure_code ) endif(HAVE_BETTER_YASM_ELF64) @@ -150,7 +150,7 @@ add_ceph_unittest(unittest_erasure_code_lrc ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/un target_link_libraries(unittest_erasure_code_lrc global osd - dl + ${CMAKE_DL_LIBS} ec_lrc common ) @@ -169,7 +169,7 @@ add_dependencies(unittest_erasure_code_plugin_lrc target_link_libraries(unittest_erasure_code_plugin_lrc global osd - dl + ${CMAKE_DL_LIBS} ec_lrc ec_jerasure_generic common) @@ -198,7 +198,7 @@ add_ceph_unittest(unittest_erasure_code_plugin_shec ${CMAKE_RUNTIME_OUTPUT_DIREC target_link_libraries(unittest_erasure_code_plugin_shec global osd - dl + ${CMAKE_DL_LIBS} common ec_shec_generic) add_dependencies(unittest_erasure_code_plugin_shec @@ -220,7 +220,7 @@ add_ceph_unittest(unittest_erasure_code_example ${CMAKE_RUNTIME_OUTPUT_DIRECTORY target_link_libraries(unittest_erasure_code_example global osd - dl + ${CMAKE_DL_LIBS} common erasure_code ${UNITTEST_LIBS} @@ -253,7 +253,7 @@ add_ceph_unittest(unittest_erasure_code_shec ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/u target_link_libraries(unittest_erasure_code_shec global osd - dl + ${CMAKE_DL_LIBS} common ec_shec_generic ) @@ -266,7 +266,7 @@ add_ceph_unittest(unittest_erasure_code_shec_all ${CMAKE_RUNTIME_OUTPUT_DIRECTOR target_link_libraries(unittest_erasure_code_shec_all global osd - dl + ${CMAKE_DL_LIBS} common ec_shec_generic ) @@ -279,7 +279,7 @@ add_ceph_unittest(unittest_erasure_code_shec_thread ${CMAKE_RUNTIME_OUTPUT_DIREC target_link_libraries(unittest_erasure_code_shec_thread global osd - dl + ${CMAKE_DL_LIBS} common ec_shec_generic ) @@ -293,7 +293,7 @@ add_ceph_unittest(unittest_erasure_code_shec_arguments ${CMAKE_RUNTIME_OUTPUT_DI target_link_libraries(unittest_erasure_code_shec_arguments global osd - dl + ${CMAKE_DL_LIBS} common ec_shec_generic ) diff --git a/src/test/osd/CMakeLists.txt b/src/test/osd/CMakeLists.txt index 2ba9fdbfcb0..baf26aec810 100644 --- a/src/test/osd/CMakeLists.txt +++ b/src/test/osd/CMakeLists.txt @@ -52,14 +52,14 @@ add_executable(unittest_osdscrub TestOSDScrub.cc ) add_ceph_unittest(unittest_osdscrub ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_osdscrub) -target_link_libraries(unittest_osdscrub osd global dl os mon ${BLKID_LIBRARIES}) +target_link_libraries(unittest_osdscrub osd global ${CMAKE_DL_LIBS} os mon ${BLKID_LIBRARIES}) # unittest_pglog add_executable(unittest_pglog TestPGLog.cc ) add_ceph_unittest(unittest_pglog ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_pglog) -target_link_libraries(unittest_pglog osd global dl ${BLKID_LIBRARIES}) +target_link_libraries(unittest_pglog osd global ${CMAKE_DL_LIBS} ${BLKID_LIBRARIES}) # unittest_hitset add_executable(unittest_hitset diff --git a/src/tracing/CMakeLists.txt b/src/tracing/CMakeLists.txt index 2bc837b870f..7d0749d9ee1 100644 --- a/src/tracing/CMakeLists.txt +++ b/src/tracing/CMakeLists.txt @@ -30,7 +30,7 @@ function(add_tracing_library name tracings version) ${header_dir}/${tp}.c) endforeach() add_library(${name} SHARED ${srcs}) - target_link_libraries(${name} ${LTTNG_LIBRARIES} dl) + target_link_libraries(${name} ${LTTNG_LIBRARIES} ${CMAKE_DL_LIBS}) string(REGEX MATCH "^[0-9]+" soversion ${version}) set_target_properties(${name} PROPERTIES OUTPUT_NAME ${name}