From f39f756a7e3268b35d2859ca5f963bbc0589754a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Wed, 12 Jun 2024 18:49:21 +0200 Subject: [PATCH 1/2] GraphBLAS: Use library as provided by CMake for dlopen and Co Most UNIX-like systems provide `dlopen` and similar functions in a library named libdl. On some platforms (like NetBSD), these functions are not in a library. They can be used in any dynamically linked program instead: https://man.netbsd.org/dlopen.3 Other platforms (e.g., IBM AIX) provide these functions in a differently named library (e.g., libld). Use the name of the library containing `dlopen` and similar functions as provided by CMake. --- GraphBLAS/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GraphBLAS/CMakeLists.txt b/GraphBLAS/CMakeLists.txt index 8677da436b..a953fbaa90 100644 --- a/GraphBLAS/CMakeLists.txt +++ b/GraphBLAS/CMakeLists.txt @@ -409,13 +409,13 @@ if ( NOT NO_LIBM ) endif ( ) # libdl -if ( NOT WIN32 ) +if ( NOT "${CMAKE_DL_LIBS}" STREQUAL "" ) if ( BUILD_SHARED_LIBS ) - target_link_libraries ( GraphBLAS PRIVATE dl ) + target_link_libraries ( GraphBLAS PRIVATE ${CMAKE_DL_LIBS} ) endif ( ) if ( BUILD_STATIC_LIBS ) - list ( APPEND GRAPHBLAS_STATIC_LIBS "dl" ) - target_link_libraries ( GraphBLAS_static PUBLIC dl ) + list ( APPEND GRAPHBLAS_STATIC_LIBS ${CMAKE_DL_LIBS} ) + target_link_libraries ( GraphBLAS_static PUBLIC ${CMAKE_DL_LIBS} ) endif ( ) endif ( ) From 711a7d12334fd3482fe47b916dc730c3590bc7a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Wed, 12 Jun 2024 21:13:39 +0200 Subject: [PATCH 2/2] Revert: mongoose: no declspec(dllimport) for static data This (partly) reverts 7c5caf65cd9723eb62d6e8d7f4884d315191c4c0 Static members of a class can be accessed without instantiating the class: https://en.cppreference.com/w/cpp/language/static That is conceptionally different from static data. They require `dllexport`/`dllimport` attributes to be correctly exported from dlls using MSVC. --- Mongoose/Include/Mongoose_Logger.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Mongoose/Include/Mongoose_Logger.hpp b/Mongoose/Include/Mongoose_Logger.hpp index 699b992b52..1efd7cc7ae 100644 --- a/Mongoose/Include/Mongoose_Logger.hpp +++ b/Mongoose/Include/Mongoose_Logger.hpp @@ -103,10 +103,10 @@ typedef enum TimingType class Logger { private: - /* MONGOOSE_API */ static int debugLevel; - /* MONGOOSE_API */ static bool timingOn; - /* MONGOOSE_API */ static double clocks[6]; - /* MONGOOSE_API */ static float times[6]; + MONGOOSE_API static int debugLevel; + MONGOOSE_API static bool timingOn; + MONGOOSE_API static double clocks[6]; + MONGOOSE_API static float times[6]; public: static inline void tic(TimingType timingType);