Skip to content

mingw buildability #19349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions build/cmake/FindSndFile.cmake
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
include(GetPlatformInfo)

if (OS_IS_WIN)
if (OS_IS_WIN AND (NOT MINGW))
find_path(SNDFILE_INCDIR sndfile.h PATHS ${PROJECT_SOURCE_DIR}/dependencies/include;)
if (MINGW)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
else (MINGW)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
endif (MINGW)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
find_library(SNDFILE_LIB NAMES sndfile libsndfile-1 PATHS ${DEPENDENCIES_DIR} NO_DEFAULT_PATH)
if (MINGW)
set(SNDFILE_DLL ${SNDFILE_LIB})
else (MINGW)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
find_library(SNDFILE_DLL NAMES sndfile libsndfile-1 PATHS ${DEPENDENCIES_DIR} NO_DEFAULT_PATH)
message(STATUS "Found sndfile DLL: ${SNDFILE_DLL}")
endif (MINGW)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
find_library(SNDFILE_DLL NAMES sndfile libsndfile-1 PATHS ${DEPENDENCIES_DIR} NO_DEFAULT_PATH)
message(STATUS "Found sndfile DLL: ${SNDFILE_DLL}")

elseif (OS_IS_WASM)
set(LIBSND_PATH "" CACHE PATH "Path to libsnd sources")
Expand Down
8 changes: 4 additions & 4 deletions src/framework/global/dlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#ifndef MU_GLOBAL_DLIB_H
#define MU_GLOBAL_DLIB_H

#ifdef Q_OS_WIN
#if defined(Q_OS_WIN) && !defined(__MINGW64__)
#include <windows.h>
#else
#include <dlfcn.h>
Expand All @@ -34,7 +34,7 @@
namespace mu {
inline void* loadLib(const io::path_t& path)
{
#ifdef Q_OS_WIN
#if defined(Q_OS_WIN) && !defined(__MINGW64__)
return LoadLibrary(path.toStdWString().c_str());
#else
return dlopen(path.c_str(), RTLD_LAZY);
Expand All @@ -43,7 +43,7 @@ inline void* loadLib(const io::path_t& path)

inline void* getLibFunc(void* libHandle, const char* funcName)
{
#ifdef Q_OS_WIN
#if defined(Q_OS_WIN) && !defined(__MINGW64__)
return GetProcAddress((HINSTANCE)libHandle, funcName);
#else
return dlsym(libHandle, funcName);
Expand All @@ -52,7 +52,7 @@ inline void* getLibFunc(void* libHandle, const char* funcName)

inline void closeLib(void* libHandle)
{
#ifdef Q_OS_WIN
#if defined(Q_OS_WIN) && !defined(__MINGW64__)
UNUSED(libHandle);
return;
#else
Expand Down