Skip to content

Fix MinGW cross-compilation #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed

Conversation

SaiyanRiku
Copy link

@SaiyanRiku SaiyanRiku commented Jul 16, 2020

Hi,

I succeed to cross compile the mysql-connector-cpp from Linux to MinGW (32/64 bits), with these minors fixes and a workaround to use the host version of protoc and save_linker_opts.

Could you please integrate them into the project ?

Here the script i use to make it works :

#!/bin/bash

ROOT=$(pwd)
SRC_PATH=${ROOT}/mysqlconnectorcpp-src
BUILD_HOST_PATH=${ROOT}/mysqlconnectorcpp-build-host
BUILD_TARGET_PATH=${ROOT}/mysqlconnectorcpp-build-target
RELEASE_PATH=${ROOT}/mysqlconnectorcpp-release

SSL_PATH=$(pwd)/openssl

# get the sources
git clone https://github.com/Jet1oeil/mysql-connector-cpp.git ${SRC_PATH}

# build the host version to get executable working
mkdir -p $BUILD_HOST_PATH
cd $BUILD_HOST_PATH
cmake -G"Unix Makefiles" $SRC_PATH
make

# build the target version
mkdir -p $BUILD_TARGET_PATH
cd $BUILD_TARGET_PATH
cmake -G"Unix Makefiles" -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_PROCESSOR=AMD64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${RELEASE_PATH} -DWITH_SSL=${SSL_PATH} -DCMAKE_C_COMPILER=/usr/bin/x86_64-w64-mingw32-gcc-posix -DCMAKE_CXX_COMPILER=/usr/bin/x86_64-w64-mingw32-g++-posix -DCMAKE_RC_COMPILER=/usr/bin/x86_64-w64-mingw32-windres ${SRC_PATH}
ln -s ${BUILD_HOST_PATH}/save_linker_opts save_linker_opts
ln -s ${BUILD_HOST_PATH}/cdk/protobuf/protoc cdk/protobuf/protoc
sed -i 's/protoc.exe/protoc/g' cdk/protocol/mysqlx/CMakeFiles/cdk_proto_mysqlx.dir/build.make
make
make install

@mysql-oca-bot
Copy link

Hi, thank you for submitting this pull request. In order to consider your code we need you to sign the Oracle Contribution Agreement (OCA). Please review the details and follow the instructions at http://www.oracle.com/technetwork/community/oca-486395.html
Please make sure to include your MySQL bug system user (email) in the returned form.
Thanks

@SaiyanRiku
Copy link
Author

Hi, i just send the OCA.

@mysql-oca-bot
Copy link

Hi, thank you for your contribution. Please confirm this code is submitted under the terms of the OCA (Oracle's Contribution Agreement) you have previously signed by cutting and pasting the following text as a comment:
"I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it."
Thanks

@SaiyanRiku
Copy link
Author

I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

@mysql-oca-bot
Copy link

Hi, thank you for your contribution. Your code has been assigned to an internal queue. Please follow
bug http://bugs.mysql.com/bug.php?id=100248 for updates.
Thanks

@lefred
Copy link

lefred commented Oct 20, 2020

Thank you for your contribution that has been added to 8.0.22: https://lefred.be/content/mysql-8-0-22-thank-you-for-the-contributions/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants