Remove mingw-std-threads from 3rd party deps and use native libs/headers instead (#7283)

* Remove mingw-std-threads from 3rd party deps

 and use native libs/headers instead

* switch MinGW to POSIX in CI
This commit is contained in:
FyiurAmron
2024-06-30 21:49:06 +02:00
committed by GitHub
parent 13a05b99d3
commit edf6bf8dfe
12 changed files with 7 additions and 61 deletions

View File

@@ -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>

View File

@@ -66,21 +66,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} SYSTEM 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)

View File

@@ -111,12 +111,6 @@ set_target_properties(zynaddsubfx_nio PROPERTIES SYSTEM TRUE)
set_target_properties(zynaddsubfx_gui PROPERTIES SYSTEM TRUE)
set_target_properties(zynaddsubfx_synth PROPERTIES SYSTEM TRUE)
if(MINGW)
target_link_libraries(zynaddsubfx_nio PUBLIC mingw_stdthreads)
target_link_libraries(zynaddsubfx_gui PUBLIC mingw_stdthreads)
target_link_libraries(zynaddsubfx_synth PUBLIC mingw_stdthreads)
endif()
# Relative include paths don't work automatically for the GUI, because the
# generated C++ files aren't in the source directory. Thus, add the expected
# source directory as an additional include directory.

View File

@@ -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