Skip to content

Commit 57b753a

Browse files
committed
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.
1 parent a74dd39 commit 57b753a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ STRING(REGEX REPLACE "^.*LIBGIT2_SOVERSION ([0-9]+)$" "\\1" LIBGIT2_SOVERSION "$
107107

108108
# Platform specific compilation flags
109109
IF (MSVC)
110+
IF (STDCALL)
111+
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.")
112+
ENDIF()
113+
110114
ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS)
111115
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
112116
ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE)

0 commit comments

Comments
 (0)