-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Description
Using MinGW in combination with MSYS you have to use the "MSYS Makefiles" generator like this:
$ cd liboauthcpp/build
$ cmake . -G "MSYS Makefiles"
$ make
In the last step it fails because of the following piece of logic in the CMakeFiles.txt (line 36-40):
# Disable some annoying, unnecessary Windows warnings. Enable unwinding for exception handlers.
IF(WIN32)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -EHsc)
SET(CMAKE_CXX_FLAGS "-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS")
ENDIF()
It adds the -EHsc parameter, amongst other things, to the compiler parameters and during make this fails:
$ make
Scanning dependencies of target oauthcpp
[ 7%] Building CXX object CMakeFiles/oauthcpp.dir/C_/dev/cpp/libs/liboauthcpp-testing/src/base64.obj
g++.exe: error: unrecognized command line option '-EHsc'
make[2]: *** [CMakeFiles/oauthcpp.dir/C_/dev/cpp/libs/liboauthcpp-testing/src/base64.obj] Error 1
make[1]: *** [CMakeFiles/oauthcpp.dir/all] Error 2
make: *** [all] Error 2
I presume there's some logic missing in order to detect whether it's a Windows platform and using MSVC for the exception settings. When you comment out these lines and run it again everything builds fine.
Metadata
Metadata
Assignees
Labels
No labels