diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2019-01-09 12:47:40 +0000 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2019-01-17 21:17:32 +0000 |
| commit | 57b753a0dc0db2d89341300470653e8a4d066c0b (patch) | |
| tree | 0e5cee083d372217085085ff3eac0a345b6b05bc | |
| parent | a74dd39b232ae8c54517446089316b9643b3a84a (diff) | |
| download | libgit2-57b753a0dc0db2d89341300470653e8a4d066c0b.tar.gz | |
cmake: error when STDCALL is specified
To explicitly break end-users who were specifying STDCALL, explicitly
fail the cmake process to ensure that they know that they need to change
their bindings. Otherwise, we would quietly ignore their option and the
resulting cdecl library would produced undefined behavior.
| -rw-r--r-- | CMakeLists.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f1da8c9f0..bc3f07c11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,6 +107,10 @@ STRING(REGEX REPLACE "^.*LIBGIT2_SOVERSION ([0-9]+)$" "\\1" LIBGIT2_SOVERSION "$ # Platform specific compilation flags IF (MSVC) + IF (STDCALL) + MESSAGE(FATAL_ERROR "The STDCALL option is no longer supported; libgit2 is now always built as a cdecl library. If you're using PInvoke, please add the CallingConventions.Cdecl attribute for support.") + ENDIF() + ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS) ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE) |
