diff options
-rw-r--r-- | include/sysconf.h.cmake | 3 | ||||
-rw-r--r-- | modules/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/modulemanager.cpp | 6 |
3 files changed, 9 insertions, 6 deletions
diff --git a/include/sysconf.h.cmake b/include/sysconf.h.cmake index 35f876b5e..b8182cc58 100644 --- a/include/sysconf.h.cmake +++ b/include/sysconf.h.cmake @@ -14,6 +14,9 @@ // The default umask to use for files. #cmakedefine DEFUMASK @DEFUMASK@ +// The extension used for module file extensions. +#define DLL_EXT "@CMAKE_SHARED_LIBRARY_SUFFIX@" + // Whether Anope was built in debug mode. #cmakedefine01 DEBUG_BUILD diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index c0736cd84..98bcf54d4 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -55,8 +55,8 @@ macro(build_modules SRC) set_source_files_properties(${MODULE_SRC} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}") file(RELATIVE_PATH FNAME ${SRC} ${MODULE_SRC}) - # Convert the real source file extension to have a .so extension - string(REGEX REPLACE "\\.cpp$" ".so" SO ${FNAME}) + # Convert the real source file extension to have a library extension + string(REGEX REPLACE "\\.cpp$" "${CMAKE_SHARED_LIBRARY_SUFFIX}" SO ${FNAME}) # Reset linker flags set(TEMP_LDFLAGS) # Reset extra dependencies @@ -111,7 +111,7 @@ macro(build_subdir) list(SORT MODULES_SUBDIR_SRCS) GET_FILENAME_COMPONENT(FOLDER_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME) - set(SO "${FOLDER_NAME}.so") + set(SO "${FOLDER_NAME}.${CMAKE_SHARED_LIBRARY_SUFFIX}") # Set all the files to use C++ as well as set their compile flags (use the module-specific compile flags, though) set_source_files_properties(${MODULES_SUBDIR_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}") diff --git a/src/modulemanager.cpp b/src/modulemanager.cpp index cbb3460a9..f210593b8 100644 --- a/src/modulemanager.cpp +++ b/src/modulemanager.cpp @@ -55,7 +55,7 @@ void ModuleManager::CleanupRuntimeDirectory() */ static ModuleReturn moduleCopyFile(const Anope::string &name, Anope::string &output) { - Anope::string input = Anope::ModuleDir + "/modules/" + name + ".so"; + Anope::string input = Anope::ModuleDir + "/modules/" + name + DLL_EXT; struct stat s; if (stat(input.c_str(), &s) == -1) @@ -133,7 +133,7 @@ ModuleReturn ModuleManager::LoadModule(const Anope::string &modname, User *u) #ifdef _WIN32 /* Generate the filename for the temporary copy of the module */ - Anope::string pbuf = Anope::DataDir + "/runtime/" + modname + ".so.XXXXXX"; + Anope::string pbuf = Anope::DataDir + "/runtime/" + modname + DLL_EXT ".XXXXXX"; /* Don't skip return value checking! -GD */ ModuleReturn ret = moduleCopyFile(modname, pbuf); @@ -146,7 +146,7 @@ ModuleReturn ModuleManager::LoadModule(const Anope::string &modname, User *u) return ret; } #else - Anope::string pbuf = Anope::ModuleDir + "/modules/" + modname + ".so"; + Anope::string pbuf = Anope::ModuleDir + "/modules/" + modname + DLL_EXT; #endif dlerror(); |