Skip to content

Commit 1bef182

Browse files
committed
Added xcode properties required for notarization to C/C plugins
and install_driver targets. Fix of the test in types tests set. It could fail with some compilers/platforms(noticed on macos)
1 parent f4a891d commit 1bef182

File tree

4 files changed

+33
-6
lines changed

4 files changed

+33
-6
lines changed

CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ ENDIF()
150150
### Including C/C subproject
151151
IF(EXISTS ${CMAKE_SOURCE_DIR}/libmariadb)
152152
IF(GIT_BUILD_SRCPKG)
153-
# We don't want conn/c (wrong) src pkg to be built.
153+
# We don't want with conn/c (wrong) src pkg to be built.
154154
SET(GIT_BUILD_SRCPKG FALSE)
155155
SET(ODBC_GIT_BUILD_SRCPKG TRUE)
156156
ENDIF()
@@ -159,6 +159,18 @@ IF(EXISTS ${CMAKE_SOURCE_DIR}/libmariadb)
159159

160160
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/libmariadb/include)
161161
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}/libmariadb/include)
162+
SET(PLUGINS_LIST dialog caching_sha2_password auth_gssapi_client sha256_password mysql_clear_password client_ed25519)
163+
IF(APPLE)
164+
SET_TARGET_PROPERTIES(${PLUGINS_LIST}
165+
PROPERTIES XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME YES
166+
XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--timestamp -f"
167+
)
168+
IF(WITH_SIGNCODE)
169+
SET_TARGET_PROPERTIES(${PLUGINS_LIST} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Developer ID Application: ${DEVELOPER_ID}")
170+
ELSE()
171+
SET_TARGET_PROPERTIES(${PLUGINS_LIST} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
172+
ENDIF()
173+
ENDIF()
162174
ELSE()
163175
SET(USE_SYSTEM_INSTALLED_LIB TRUE)
164176
# Adding mariadb subdirs of standard include locations

libmariadb

osxinstall/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,19 @@ TARGET_LINK_LIBRARIES(install_driver ${ODBC_INSTLIBS})#${PLATFORM_DEPENDENCIES})
7171
# On Windows should look like
7272
#TARGET_LINK_LIBRARIES(install_driver ${ODBC_INSTLIBS} legacy_stdio_definitions Shlwapi)
7373

74+
IF(APPLE)
75+
SET_TARGET_PROPERTIES(install_driver
76+
PROPERTIES XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME YES
77+
XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--timestamp -f"
78+
)
79+
IF(WITH_SIGNCODE)
80+
SET_TARGET_PROPERTIES(install_driver
81+
PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Developer ID Application: ${DEVELOPER_ID}"
82+
XCODE_ATTRIBUTE_CODE_SIGN_INJECT_BASE_ENTITLEMENTS "NO")
83+
ELSE()
84+
SET_TARGET_PROPERTIES(install_driver PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
85+
ENDIF()
86+
ENDIF()
7487

7588
IF(USE_SYSTEM_INSTALLED_LIB)
7689
ADD_CUSTOM_TARGET(copypkgfiles

test/types.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ int sqlnum_test_from_str(SQLHANDLE Stmt,
806806
SQL_NUMERIC_STRUCT *sqlnum= malloc(sizeof(SQL_NUMERIC_STRUCT));
807807
SQLCHAR buf[512];
808808
SQLHANDLE ard;
809-
unsigned long numval;
809+
unsigned long long numval;
810810

811811
sprintf((char *)buf, "SELECT %s", numstr);
812812
/* OK_SIMPLE_STMT(Stmt, buf); */
@@ -822,7 +822,6 @@ int sqlnum_test_from_str(SQLHANDLE Stmt,
822822
(SQLPOINTER)(SQLLEN) scale, SQL_IS_INTEGER));
823823
CHECK_HANDLE_RC(SQL_HANDLE_DESC, ard, SQLSetDescField(ard, 1, SQL_DESC_DATA_PTR,
824824
sqlnum, SQL_IS_POINTER));
825-
826825
if (overflow != SQL_SUCCESS)
827826
{
828827
EXPECT_STMT(Stmt, SQLFetch(Stmt), overflow);
@@ -850,10 +849,13 @@ int sqlnum_test_from_str(SQLHANDLE Stmt,
850849
{
851850
/* only use this for <=32bit values */
852851
int i;
852+
unsigned long long singleByte;
853853
numval= 0;
854854
for (i= 0; i < 8; ++i)
855-
numval += sqlnum->val[7 - i] << (8 * (7 - i));
856-
855+
{
856+
singleByte= sqlnum->val[7 - i];
857+
numval+= singleByte << (8 * (7 - i));
858+
}
857859
if (numval != expnum)
858860
diag("compare %d %d", numval, expnum);
859861
is_num(numval, expnum);

0 commit comments

Comments
 (0)