From 6802761e497a16d2c7c4f1f276a38f69bd4585ab Mon Sep 17 00:00:00 2001 From: Scott Duensing Date: Tue, 7 Nov 2023 21:25:51 -0600 Subject: [PATCH] Migrating to using Toolchains compilers. --- build-all.sh | 29 ++++++++++++++++++++++++++-- cmake/i686-linux-gnu.cmake | 30 ----------------------------- cmake/i686-w64-mingw32.cmake | 35 ---------------------------------- cmake/x86_64-linux-gnu.cmake | 25 ------------------------ cmake/x86_64-w64-mingw32.cmake | 32 ------------------------------- 5 files changed, 27 insertions(+), 124 deletions(-) delete mode 100644 cmake/i686-linux-gnu.cmake delete mode 100644 cmake/i686-w64-mingw32.cmake delete mode 100644 cmake/x86_64-linux-gnu.cmake delete mode 100644 cmake/x86_64-w64-mingw32.cmake diff --git a/build-all.sh b/build-all.sh index 0d2d15399..1b406c4b3 100755 --- a/build-all.sh +++ b/build-all.sh @@ -33,6 +33,7 @@ function buildAll() { local TOOLCHAIN= local COMMON= local CROSS_OS= + local OSXCROSS_LOCATION= case "${OS}" in @@ -49,6 +50,27 @@ function buildAll() { CROSS_OS="linux" ;; + macos) + case "${ARCH}" in + aarch64) + TRIPLE="aarch64-apple-darwin22.4" + OSXCROSS_LOCATION=${G_BUILDROOT}/../toolchains/x-tools/aarch64-macos-apple + ;; + x86) + TRIPLE="i386-apple-darwin17" + OSXCROSS_LOCATION=${G_BUILDROOT}/../toolchains/x-tools/x86_64-macos-apple + ;; + x86_64) + TRIPLE="x86_64-apple-darwin17" + OSXCROSS_LOCATION=${G_BUILDROOT}/../toolchains/x-tools/x86_64-macos-apple + ;; + esac + CROSS_OS="darwin" + source <("${OSXCROSS_LOCATION}/bin/osxcross-conf" 2>/dev/null) + export OSXCROSS_LOCATION + ;; + + windows) case "${ARCH}" in x86) @@ -66,7 +88,7 @@ function buildAll() { G_TARGET=${G_BUILDROOT}/build/${OS}/${ARCH} G_GENERATED=${G_TARGET}/generated - TOOLCHAIN=${G_BUILDROOT}/cmake/${TRIPLE}.cmake + TOOLCHAIN=${G_BUILDROOT}/../toolchains/cmake/${TRIPLE}.cmake COMMON="-DCMAKE_INSTALL_PREFIX=${G_TARGET} -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN}" # Add CMAKE_BUILD_TYPE to COMMON @@ -387,6 +409,9 @@ function outputLicense() { #buildAll linux x86 -buildAll linux x86_64 +#buildAll linux x86_64 +buildAll macos aarch64 +#buildAll macos x86 #***TODO*** Needs older SDL2 +#buildAll macos x86_64 #***TODO*** Needs older SDL2 #buildAll windows x86 #buildAll windows x86_64 diff --git a/cmake/i686-linux-gnu.cmake b/cmake/i686-linux-gnu.cmake deleted file mode 100644 index 18df0f59c..000000000 --- a/cmake/i686-linux-gnu.cmake +++ /dev/null @@ -1,30 +0,0 @@ -# -# Singe 2 -# Copyright (C) 2006-2024 Scott Duensing -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public Licens -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - - -set(CMAKE_SYSTEM_NAME Linux) -set(CMAKE_SYSTEM_PROCESSOR i686) - -set(CMAKE_C_COMPILER i686-linux-gnu-gcc) -set(CMAKE_C_FLAGS -m32) -set(CMAKE_CXX_COMPILER i686-linux-gnu-g++) -set(CMAKE_CXX_FLAGS -m32) - -set(KANGAROO_OS linux) -set(KANGAROO_ARCH x86) diff --git a/cmake/i686-w64-mingw32.cmake b/cmake/i686-w64-mingw32.cmake deleted file mode 100644 index 1b43bb6e2..000000000 --- a/cmake/i686-w64-mingw32.cmake +++ /dev/null @@ -1,35 +0,0 @@ -# -# Singe 2 -# Copyright (C) 2006-2024 Scott Duensing -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public Licens -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - - -set(CMAKE_SYSTEM_NAME Windows) -set(CMAKE_SYSTEM_PROCESSOR i686) - -set(triple i686-w64-mingw32) - -set(CMAKE_C_COMPILER i686-w64-mingw32-gcc-10-posix) -set(CMAKE_C_COMPILER_TARGET ${triple}) -set(CMAKE_CXX_COMPILER i686-w64-mingw32-c++-posix) -set(CMAKE_CXX_COMPILER_TARGET ${triple}) - -set(CMAKE_C_FLAGS -m32) -set(CMAKE_CXX_FLAGS -m32) - -set(KANGAROO_OS windows) -set(KANGAROO_ARCH x86) diff --git a/cmake/x86_64-linux-gnu.cmake b/cmake/x86_64-linux-gnu.cmake deleted file mode 100644 index 5cea68812..000000000 --- a/cmake/x86_64-linux-gnu.cmake +++ /dev/null @@ -1,25 +0,0 @@ -# -# Singe 2 -# Copyright (C) 2006-2024 Scott Duensing -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public Licens -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - - -set(CMAKE_SYSTEM_NAME Linux) -set(CMAKE_SYSTEM_PROCESSOR x86_64) - -set(KANGAROO_OS linux) -set(KANGAROO_ARCH x86_64) diff --git a/cmake/x86_64-w64-mingw32.cmake b/cmake/x86_64-w64-mingw32.cmake deleted file mode 100644 index 8a50a73f1..000000000 --- a/cmake/x86_64-w64-mingw32.cmake +++ /dev/null @@ -1,32 +0,0 @@ -# -# Singe 2 -# Copyright (C) 2006-2024 Scott Duensing -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public Licens -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - - -set(CMAKE_SYSTEM_NAME Windows) -set(CMAKE_SYSTEM_PROCESSOR x86_64) - -set(triple x86_64-w64-mingw32) - -set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc-10-posix) -set(CMAKE_C_COMPILER_TARGET ${triple}) -set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-c++-posix) -set(CMAKE_CXX_COMPILER_TARGET ${triple}) - -set(KANGAROO_OS windows) -set(KANGAROO_ARCH x86_64)