Cross-Platform build scripts for audio plugins
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1007B

  1. diff --git a/CMakeLists.txt b/CMakeLists.txt
  2. index cf35bbb..625dc67 100644
  3. --- a/CMakeLists.txt
  4. +++ b/CMakeLists.txt
  5. @@ -237,6 +237,12 @@ if( HAVE_LIBM )
  6. list( APPEND CMAKE_REQUIRED_LIBRARIES -lm )
  7. endif()
  8. +# mingw fails to find math library (used in system libraries), force it here
  9. +if( MINGW )
  10. + set( LIB_m m )
  11. + MARK_AS_ADVANCED( FORCE LIB_m )
  12. +endif()
  13. +
  14. check_library_exists( atomic __atomic_fetch_add_4 "" HAVE_LIBATOMIC )
  15. if( HAVE_LIBATOMIC )
  16. list( APPEND CMAKE_REQUIRED_LIBRARIES -latomic )
  17. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
  18. index 8e31f03..4badeeb 100644
  19. --- a/src/CMakeLists.txt
  20. +++ b/src/CMakeLists.txt
  21. @@ -1064,6 +1064,11 @@ list( APPEND LIBRARIES
  22. $<$<PLATFORM_ID:Linux,FreeBSD,OpenBSD,NetBSD,CYGWIN>:pthread>
  23. )
  24. +# mingw needs these too
  25. +if( CMAKE_SYSTEM_NAME MATCHES "Windows" AND NOT MSVC)
  26. + list( APPEND LIBRARIES PUBLIC z pthread)
  27. +endif()
  28. +
  29. set( BUILDING_AUDACITY YES )
  30. set( INSTALL_PREFIX "${_PREFIX}" )
  31. set( PKGLIBDIR "${_PKGLIBDIR}" )