Skip to content

Commit

Permalink
Remove mingw-std-threads from 3rd party deps
Browse files Browse the repository at this point in the history
 and use native libs/headers instead
  • Loading branch information
FyiurAmron committed May 29, 2024
1 parent 5f8b7a7 commit 97c7b8c
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 47 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
[submodule "src/3rdparty/weakjack/weakjack"]
path = src/3rdparty/weakjack/weakjack
url = https://github.com/x42/weakjack.git
[submodule "src/3rdparty/mingw-std-threads"]
path = src/3rdparty/mingw-std-threads
url = https://github.com/meganz/mingw-std-threads.git
[submodule "doc/wiki"]
path = doc/wiki
url = https://github.com/lmms/lmms.wiki.git
Expand Down
4 changes: 0 additions & 4 deletions include/AudioEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@
#ifndef LMMS_AUDIO_ENGINE_H
#define LMMS_AUDIO_ENGINE_H

#ifdef __MINGW32__
#include <mingw.mutex.h>
#else
#include <mutex>
#endif

#include <QThread>
#include <samplerate.h>
Expand Down
6 changes: 0 additions & 6 deletions include/FileBrowserSearcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,9 @@
#include <optional>
#include <queue>

#ifdef __MINGW32__
#include <mingw.condition_variable.h>
#include <mingw.mutex.h>
#include <mingw.thread.h>
#else
#include <condition_variable>
#include <mutex>
#include <thread>
#endif

namespace lmms::gui {

Expand Down
6 changes: 1 addition & 5 deletions plugins/VstBase/RemoteVstPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@
#undef Unsorted
#endif

#ifdef USE_MINGW_THREADS_REPLACEMENT
# include <mingw.mutex.h>
#else
# include <mutex>
#endif
#include <mutex>

#include <algorithm>
#include <vector>
Expand Down
15 changes: 0 additions & 15 deletions plugins/VstBase/RemoteVstPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,6 @@ endif()

if(IS_MINGW)
SET(CMAKE_REQUIRED_FLAGS "-std=c++17")

CHECK_CXX_SOURCE_COMPILES("
#include <mutex>
int main(int argc, const char* argv[]) {
std::mutex m;
return 0;
}
" HAS_STD_MUTEX)

if(NOT HAS_STD_MUTEX)
target_include_directories(${EXE_NAME} PRIVATE
"${LMMS_SOURCE_DIR}/src/3rdparty/mingw-std-threads")
target_compile_definitions(${EXE_NAME} PRIVATE
-DUSE_MINGW_THREADS_REPLACEMENT)
endif()
endif()

if(LMMS_BUILD_WIN32)
Expand Down
1 change: 0 additions & 1 deletion plugins/ZynAddSubFx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ include_directories(
${FFTW3F_INCLUDE_DIRS}
"${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_BINARY_DIR}"
"${CMAKE_SOURCE_DIR}/src/3rdparty/mingw-std-threads"
"${CMAKE_CURRENT_SOURCE_DIR}/zynaddsubfx/src/UI"
)

Expand Down
6 changes: 0 additions & 6 deletions plugins/ZynAddSubFx/ThreadShims.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
#include <condition_variable>
#include <mutex>
#include <thread>

#if defined(__MINGW32__) && !defined(_GLIBCXX_HAS_GTHREADS)
# include <mingw.condition_variable.h>
# include <mingw.mutex.h>
# include <mingw.thread.h>
#endif
6 changes: 0 additions & 6 deletions src/3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ ENDIF()
ADD_SUBDIRECTORY(hiir)
ADD_SUBDIRECTORY(weakjack)

if(MINGW)
option(MINGW_STDTHREADS_GENERATE_STDHEADERS "" ON)
add_subdirectory(mingw-std-threads)
set(LMMS_USE_MINGW_STD_THREADS ON PARENT_SCOPE)
endif()

# The lockless ring buffer library is compiled as part of the core
SET(RINGBUFFER_DIR "${CMAKE_SOURCE_DIR}/src/3rdparty/ringbuffer/")
SET(RINGBUFFER_DIR ${RINGBUFFER_DIR} PARENT_SCOPE)
Expand Down
1 change: 0 additions & 1 deletion src/3rdparty/mingw-std-threads
Submodule mingw-std-threads deleted from 6c2061

0 comments on commit 97c7b8c

Please sign in to comment.