Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for build with MinGW #46

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

cwassmuth
Copy link

With this commits you can build anyrpc with MinGW 8.1 and Windows 10.

I have not tried if this breaks any other build configuration.

@m-kuhn
Copy link

m-kuhn commented Jul 19, 2022

Thanks !

I also had to add this for https://stackoverflow.com/questions/18551409/localtime-r-support-on-mingw

--- a/CMakeLists.txt	2020-01-13 18:31:55.000000000 +0100
+++ b/CMakeLists.txt	2022-07-19 19:29:54.339127866 +0200
@@ -63,6 +63,7 @@
     set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc" )
 elseif (MINGW)
     SET( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -U__STRICT_ANSI__" )
+    add_definitions( -D _POSIX_THREAD_SAFE_FUNCTIONS )
 elseif (BUILD_WITH_ADDRESS_SANITIZE)
     SET( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer" )
     SET( ASAN_LIBRARY asan )

@m-kuhn
Copy link

m-kuhn commented Jul 21, 2022

It compiles on linux, macos, windows microsoft/vcpkg#25901

@m-kuhn
Copy link

m-kuhn commented Jul 21, 2022

Ping @sgieseking does this look good to you?

@sgieseking
Copy link
Owner

I will see about checking it over the weekend. I don't have MinGW installed on my development computer now.

@FrankXie05
Copy link

@sgieseking Is there any progress on this PR? :)

@FrankXie05
Copy link

@sgieseking Is there any progress on this PR? :)

@cwassmuth
Copy link
Author

I removed the mingw headers. There are not used anymore

@s-weigand
Copy link

@sgieseking Are there plans on merging this? 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants