Skip to content

Commit d36ebbc

Browse files
committed
mingw buildability
1 parent 9966e8e commit d36ebbc

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

build/cmake/FindSndFile.cmake

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
include(GetPlatformInfo)
22

3-
if (OS_IS_WIN)
3+
if (OS_IS_WIN AND (NOT MINGW))
44
find_path(SNDFILE_INCDIR sndfile.h PATHS ${PROJECT_SOURCE_DIR}/dependencies/include;)
5-
if (MINGW)
6-
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
7-
else (MINGW)
8-
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
9-
endif (MINGW)
5+
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
106
find_library(SNDFILE_LIB NAMES sndfile libsndfile-1 PATHS ${DEPENDENCIES_DIR} NO_DEFAULT_PATH)
11-
if (MINGW)
12-
set(SNDFILE_DLL ${SNDFILE_LIB})
13-
else (MINGW)
14-
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
15-
find_library(SNDFILE_DLL NAMES sndfile libsndfile-1 PATHS ${DEPENDENCIES_DIR} NO_DEFAULT_PATH)
16-
message(STATUS "Found sndfile DLL: ${SNDFILE_DLL}")
17-
endif (MINGW)
7+
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
8+
find_library(SNDFILE_DLL NAMES sndfile libsndfile-1 PATHS ${DEPENDENCIES_DIR} NO_DEFAULT_PATH)
9+
message(STATUS "Found sndfile DLL: ${SNDFILE_DLL}")
1810

1911
elseif (OS_IS_WASM)
2012
set(LIBSND_PATH "" CACHE PATH "Path to libsnd sources")

src/framework/global/dlib.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#ifndef MU_GLOBAL_DLIB_H
2424
#define MU_GLOBAL_DLIB_H
2525

26-
#ifdef Q_OS_WIN
26+
#if defined(Q_OS_WIN) && !defined(__MINGW64__)
2727
#include <windows.h>
2828
#else
2929
#include <dlfcn.h>
@@ -34,7 +34,7 @@
3434
namespace mu {
3535
inline void* loadLib(const io::path_t& path)
3636
{
37-
#ifdef Q_OS_WIN
37+
#if defined(Q_OS_WIN) && !defined(__MINGW64__)
3838
return LoadLibrary(path.toStdWString().c_str());
3939
#else
4040
return dlopen(path.c_str(), RTLD_LAZY);
@@ -43,7 +43,7 @@ inline void* loadLib(const io::path_t& path)
4343

4444
inline void* getLibFunc(void* libHandle, const char* funcName)
4545
{
46-
#ifdef Q_OS_WIN
46+
#if defined(Q_OS_WIN) && !defined(__MINGW64__)
4747
return GetProcAddress((HINSTANCE)libHandle, funcName);
4848
#else
4949
return dlsym(libHandle, funcName);
@@ -52,7 +52,7 @@ inline void* getLibFunc(void* libHandle, const char* funcName)
5252

5353
inline void closeLib(void* libHandle)
5454
{
55-
#ifdef Q_OS_WIN
55+
#if defined(Q_OS_WIN) && !defined(__MINGW64__)
5656
UNUSED(libHandle);
5757
return;
5858
#else

0 commit comments

Comments
 (0)