Skip to content

Commit

Permalink
Merge pull request #243 from lucyllewy/m1-mysql
Browse files Browse the repository at this point in the history
MariadbConnector support for m1 macs
  • Loading branch information
tobil4sk authored Apr 9, 2023
2 parents 5463951 + 57963fd commit 66ec5e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 24 deletions.
21 changes: 3 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ include(CheckIncludeFile)
include(TestBigEndian)
project(Neko C)

if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
EXECUTE_PROCESS(COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE CMAKE_OSX_ARCHITECTURES)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})

if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
Expand Down Expand Up @@ -68,22 +65,10 @@ option(WITH_NEKOML "Build NekoML." ON)
# TODO libraries should not be built from this file, but rather by traversing the tree using add_subdirectory
#add_subdirectory(libs)

if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
if (${CMAKE_OSX_ARCHITECTURES} STREQUAL "i386")
set(arch_64 "")
elseif (${CMAKE_OSX_ARCHITECTURES} STREQUAL "x86_64")
set(arch_64 "64")
elseif (${CMAKE_OSX_ARCHITECTURES} STREQUAL "arm64")
set(arch_64 "64")
else()
message( FATAL_ERROR "CMAKE_OSX_ARCHITECTURES should be i386, arm64, or x86_64." )
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(arch_64 "64")
else()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(arch_64 "64")
else()
set(arch_64 "")
endif()
set(arch_64 "")
endif()

if(WIN32)
Expand Down
12 changes: 6 additions & 6 deletions libs/mysql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

if (STATIC_OPENSSL)
if (APPLE)
if (${CMAKE_OSX_ARCHITECTURES} STREQUAL "i386")
set(OPENSSL_CONF ./Configure darwin-i386-cc "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
elseif (${CMAKE_OSX_ARCHITECTURES} STREQUAL "x86_64")
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386")
set(OPENSSL_CONF ./Configure $CMAKE_C_COMPILER "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
set(OPENSSL_CONF ./Configure darwin64-x86_64-cc "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
elseif (${CMAKE_OSX_ARCHITECTURES} STREQUAL "arm64")
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64")
set(OPENSSL_CONF ./Configure darwin64-arm64-cc "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif()
else()
Expand Down Expand Up @@ -44,8 +44,8 @@ if (STATIC_OPENSSL)
endif()
ExternalProject_Add(OpenSSL
${EP_CONFIGS}
URL https://www.openssl.org/source/old/1.1.1/openssl-1.1.1.tar.gz
URL_MD5 7079eb017429e0ffb9efb42bf80ccb21
URL https://www.openssl.org/source/old/1.1.1/openssl-1.1.1k.tar.gz
URL_HASH SHA256=892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5
${OPENSSL_CONFS}
PATCH_COMMAND ${CMAKE_COMMAND} -Dopenssl_source=${CMAKE_BINARY_DIR}/libs/src/openssl -P ${CMAKE_SOURCE_DIR}/cmake/patch_openssl.cmake
SOURCE_DIR ${CMAKE_BINARY_DIR}/libs/src/openssl
Expand Down

0 comments on commit 66ec5e9

Please sign in to comment.