Build system: Start working on Cygwin support

windows
BodgeMaster 2022-10-30 19:39:27 +01:00
parent cd93f4c4c6
commit 18a9517370
4 changed files with 25 additions and 5 deletions

11
.mingw-cross.cmake Normal file
View File

@ -0,0 +1,11 @@
set(CMAKE_SYSTEM_NAME Windows)
set(WIN32 true)
set(UNIX false)
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

View File

@ -27,9 +27,13 @@ create_directory ./bin
create_directory ./bin/lib create_directory ./bin/lib
create_directory ./include create_directory ./include
if uname -s | tr [:upper:] [:lower:] | grep cygwin >/dev/null; then
ln -vs ../../dependencies/sockpp-0.7.1/build/libsockpp.dll bin/lib/libsockpp.so
else
ln -vs ../../dependencies/sockpp-0.7.1/build/libsockpp.so bin/lib/ ln -vs ../../dependencies/sockpp-0.7.1/build/libsockpp.so bin/lib/
ln -vs ../../dependencies/sockpp-0.7.1/build/libsockpp.so.0 bin/lib/ ln -vs ../../dependencies/sockpp-0.7.1/build/libsockpp.so.0 bin/lib/
ln -vs ../../dependencies/sockpp-0.7.1/build/libsockpp.so.0.7.1 bin/lib/ ln -vs ../../dependencies/sockpp-0.7.1/build/libsockpp.so.0.7.1 bin/lib/
fi
ln -vs ../dependencies/sockpp-0.7.1/include/sockpp/ ./include/ ln -vs ../dependencies/sockpp-0.7.1/include/sockpp/ ./include/
ln -vs ../dependencies/tiny-utf8-4.4.3/include/tinyutf8/ ./include/ ln -vs ../dependencies/tiny-utf8-4.4.3/include/tinyutf8/ ./include/

View File

@ -92,7 +92,12 @@ echo "done"
echo ">>> Building sockpp... " echo ">>> Building sockpp... "
pushd dependencies/sockpp-0.7.1/ >/dev/null 2>&1 pushd dependencies/sockpp-0.7.1/ >/dev/null 2>&1
if uname -s | tr [:upper:] [:lower:] | grep cygwin >/dev/null; then
echo "Adding cygwin workaound for building sockpp."
cmake -Bbuild -DCMAKE_TOOLCHAIN_FILE=$PROJECT_BASE_DIR/.mingw-cross.cmake -DSOCKPP_BUILD_SHARED=ON -DSOCKPP_BUILD_STATIC=OFF
else
cmake -Bbuild . cmake -Bbuild .
fi
cmake --build build cmake --build build
popd >/dev/null 2>&1 popd >/dev/null 2>&1

View File

@ -15,7 +15,7 @@
echo ">>> Loading shell environment for FOSS-VG development..." echo ">>> Loading shell environment for FOSS-VG development..."
PROJECT_BASE_DIR="$( cd -- "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 ; pwd -P )" export PROJECT_BASE_DIR="$( cd -- "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 ; pwd -P )"
echo "Project base directory is $PROJECT_BASE_DIR" echo "Project base directory is $PROJECT_BASE_DIR"
if [ -f "$PROJECT_BASE_DIR/.localenv.bashrc" ]; then if [ -f "$PROJECT_BASE_DIR/.localenv.bashrc" ]; then