diff --git a/CMakeLists.txt b/CMakeLists.txt index d46f58c..299c33e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,15 @@ else() add_library(singleton-atomic INTERFACE) endif() +# Modify source +if(MINGW) + file(READ ${CMAKE_SOURCE_DIR}/include/singleton_dclp.hpp DCLP) + string(REPLACE "#include \n" "" DCLP "${DCLP}") + string(REPLACE "std::shared_lock" "std::lock_guard" DCLP "${DCLP}") + string(REPLACE "std::shared_mutex" "std::mutex" DCLP "${DCLP}") + file(WRITE ${CMAKE_SOURCE_DIR}/include/singleton_dclp.hpp "${DCLP}") +endif() + # Create a singleton target add_library(singleton::singleton ALIAS singleton) target_compile_features(singleton ${SCOPE} cxx_std_11)