From 9e3ad3b79fa5fc0357f8f7b936e324b7d37b023f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Mon, 20 Dec 2021 21:54:24 +0100 Subject: [PATCH] Add comments to the toolchain files --- cmake/flags-gcc-aarch64.cmake | 20 ++++++++++++++++++++ cmake/flags-gcc-arm64.cmake | 4 ---- cmake/flags-gcc-armv7.cmake | 16 ++++++++++++++++ cmake/flags-gcc-i686.cmake | 16 ++++++++++++++++ cmake/flags-gcc-x86_64.cmake | 16 ++++++++++++++++ cmake/flags-gcc.cmake | 17 ++++++++++++++++- cmake/llvm-win32-aarch64.cmake | 30 ++++++++++++++++++++++++++++++ cmake/llvm-win32-arm64.cmake | 10 ---------- cmake/llvm-win32-i686.cmake | 32 ++++++++++++++++++++++++++------ cmake/llvm-win32-x86_64.cmake | 32 ++++++++++++++++++++++++++------ 10 files changed, 166 insertions(+), 27 deletions(-) create mode 100644 cmake/flags-gcc-aarch64.cmake delete mode 100644 cmake/flags-gcc-arm64.cmake create mode 100644 cmake/llvm-win32-aarch64.cmake delete mode 100644 cmake/llvm-win32-arm64.cmake diff --git a/cmake/flags-gcc-aarch64.cmake b/cmake/flags-gcc-aarch64.cmake new file mode 100644 index 000000000..5e37b9c3f --- /dev/null +++ b/cmake/flags-gcc-aarch64.cmake @@ -0,0 +1,20 @@ +# +# 86Box A hypervisor and IBM PC system emulator that specializes in +# running old operating systems and software designed for IBM +# PC systems and compatibles from 1981 through fairly recent +# system designs based on the PCI bus. +# +# This file is part of the 86Box distribution. +# +# CMake toolchain file defining GCC compiler flags +# for AArch64 (ARM64) targets. +# +# Authors: David Hrdlička, +# +# Copyright 2021 David Hrdlička. +# + +include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) + +set(CMAKE_C_FLAGS_INIT "-march=armv8-a -mfloat-abi=hard ${CMAKE_C_FLAGS_INIT}") +set(CMAKE_CXX_FLAGS_INIT "-march=armv8-a -mfloat-abi=hard ${CMAKE_CXX_FLAGS_INIT}") \ No newline at end of file diff --git a/cmake/flags-gcc-arm64.cmake b/cmake/flags-gcc-arm64.cmake deleted file mode 100644 index 3a0778230..000000000 --- a/cmake/flags-gcc-arm64.cmake +++ /dev/null @@ -1,4 +0,0 @@ -include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) - -set(CMAKE_C_FLAGS_INIT "-march=armv8-a -mfloat-abi=hard ${CMAKE_C_FLAGS_INIT}") -set(CMAKE_CXX_FLAGS_INIT "-march=armv8-a -mfloat-abi=hard ${CMAKE_CXX_FLAGS_INIT}") \ No newline at end of file diff --git a/cmake/flags-gcc-armv7.cmake b/cmake/flags-gcc-armv7.cmake index 9df648f54..4ee436c35 100644 --- a/cmake/flags-gcc-armv7.cmake +++ b/cmake/flags-gcc-armv7.cmake @@ -1,3 +1,19 @@ +# +# 86Box A hypervisor and IBM PC system emulator that specializes in +# running old operating systems and software designed for IBM +# PC systems and compatibles from 1981 through fairly recent +# system designs based on the PCI bus. +# +# This file is part of the 86Box distribution. +# +# CMake toolchain file defining GCC compiler flags +# for ARMv7 targets. +# +# Authors: David Hrdlička, +# +# Copyright 2021 David Hrdlička. +# + include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) set(CMAKE_C_FLAGS_INIT "-march=armv7-a -mfloat-abi=hard ${CMAKE_C_FLAGS_INIT}") diff --git a/cmake/flags-gcc-i686.cmake b/cmake/flags-gcc-i686.cmake index 84c8a7b57..9c508f17b 100644 --- a/cmake/flags-gcc-i686.cmake +++ b/cmake/flags-gcc-i686.cmake @@ -1,3 +1,19 @@ +# +# 86Box A hypervisor and IBM PC system emulator that specializes in +# running old operating systems and software designed for IBM +# PC systems and compatibles from 1981 through fairly recent +# system designs based on the PCI bus. +# +# This file is part of the 86Box distribution. +# +# CMake toolchain file defining GCC compiler flags +# for 32-bit x86 targets. +# +# Authors: David Hrdlička, +# +# Copyright 2021 David Hrdlička. +# + include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) set(CMAKE_C_FLAGS_INIT "-m32 -march=i686 -msse2 -mfpmath=sse ${CMAKE_C_FLAGS_INIT}") diff --git a/cmake/flags-gcc-x86_64.cmake b/cmake/flags-gcc-x86_64.cmake index 5ee305551..4edd2ec79 100644 --- a/cmake/flags-gcc-x86_64.cmake +++ b/cmake/flags-gcc-x86_64.cmake @@ -1,3 +1,19 @@ +# +# 86Box A hypervisor and IBM PC system emulator that specializes in +# running old operating systems and software designed for IBM +# PC systems and compatibles from 1981 through fairly recent +# system designs based on the PCI bus. +# +# This file is part of the 86Box distribution. +# +# CMake toolchain file defining GCC compiler flags +# for 64-bit x86 targets. +# +# Authors: David Hrdlička, +# +# Copyright 2021 David Hrdlička. +# + include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc.cmake) set(CMAKE_C_FLAGS_INIT "-m64 -march=x86-64 -msse2 -mfpmath=sse ${CMAKE_C_FLAGS_INIT}") diff --git a/cmake/flags-gcc.cmake b/cmake/flags-gcc.cmake index bf67340c8..bebe58f2a 100644 --- a/cmake/flags-gcc.cmake +++ b/cmake/flags-gcc.cmake @@ -1,4 +1,19 @@ -set(CMAKE_CONFIGURATION_TYPES Debug;Release;Optimized) +# +# 86Box A hypervisor and IBM PC system emulator that specializes in +# running old operating systems and software designed for IBM +# PC systems and compatibles from 1981 through fairly recent +# system designs based on the PCI bus. +# +# This file is part of the 86Box distribution. +# +# CMake toolchain file defining GCC compiler flags. +# +# Authors: David Hrdlička, +# +# Copyright 2021 David Hrdlička. +# + +set(CMAKE_CONFIGURATION_TYPES Debug;Release;Optimized) set(CMAKE_C_FLAGS_INIT "-fomit-frame-pointer -mstackrealign -Wall -fno-strict-aliasing") set(CMAKE_CXX_FLAGS_INIT ${CMAKE_C_FLAGS_INIT}) diff --git a/cmake/llvm-win32-aarch64.cmake b/cmake/llvm-win32-aarch64.cmake new file mode 100644 index 000000000..4aacb248f --- /dev/null +++ b/cmake/llvm-win32-aarch64.cmake @@ -0,0 +1,30 @@ +# +# 86Box A hypervisor and IBM PC system emulator that specializes in +# running old operating systems and software designed for IBM +# PC systems and compatibles from 1981 through fairly recent +# system designs based on the PCI bus. +# +# This file is part of the 86Box distribution. +# +# CMake toolchain file for Clang on Windows builds (ARM64 target). +# +# Authors: David Hrdlička, +# +# Copyright 2021 David Hrdlička. +# + +include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc-aarch64.cmake) + +# Use the GCC-compatible Clang executables in order to use our flags +set(CMAKE_C_COMPILER clang) +set(CMAKE_CXX_COMPILER clang++) + +# `llvm-rc` is barely usable as of LLVM 13, using MS' rc.exe for now +set(CMAKE_RC_COMPILER rc) + +set(CMAKE_C_COMPILER_TARGET aarch64-pc-windows-msvc) +set(CMAKE_CXX_COMPILER_TARGET aarch64-pc-windows-msvc) + +set(CMAKE_SYSTEM_PROCESSOR ARM64) + +# TODO: set the vcpkg target triplet perhaps? \ No newline at end of file diff --git a/cmake/llvm-win32-arm64.cmake b/cmake/llvm-win32-arm64.cmake deleted file mode 100644 index 1648382c3..000000000 --- a/cmake/llvm-win32-arm64.cmake +++ /dev/null @@ -1,10 +0,0 @@ -include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc-arm64.cmake) - -set(CMAKE_C_COMPILER clang) -set(CMAKE_CXX_COMPILER clang++) -set(CMAKE_RC_COMPILER rc) - -set(CMAKE_C_COMPILER_TARGET aarch64-pc-windows-msvc) -set(CMAKE_CXX_COMPILER_TARGET aarch64-pc-windows-msvc) - -set(CMAKE_SYSTEM_PROCESSOR ARM64) \ No newline at end of file diff --git a/cmake/llvm-win32-i686.cmake b/cmake/llvm-win32-i686.cmake index c7fec1749..8221f8bc2 100644 --- a/cmake/llvm-win32-i686.cmake +++ b/cmake/llvm-win32-i686.cmake @@ -1,10 +1,30 @@ +# +# 86Box A hypervisor and IBM PC system emulator that specializes in +# running old operating systems and software designed for IBM +# PC systems and compatibles from 1981 through fairly recent +# system designs based on the PCI bus. +# +# This file is part of the 86Box distribution. +# +# CMake toolchain file for Clang on Windows builds (x86 target). +# +# Authors: David Hrdlička, +# +# Copyright 2021 David Hrdlička. +# + include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc-i686.cmake) -set(CMAKE_C_COMPILER clang) -set(CMAKE_CXX_COMPILER clang++) -set(CMAKE_RC_COMPILER rc) +# Use the GCC-compatible Clang executables in order to use our flags +set(CMAKE_C_COMPILER clang) +set(CMAKE_CXX_COMPILER clang++) -set(CMAKE_C_COMPILER_TARGET i686-pc-windows-msvc) -set(CMAKE_CXX_COMPILER_TARGET i686-pc-windows-msvc) +# `llvm-rc` is barely usable as of LLVM 13, using MS' rc.exe for now +set(CMAKE_RC_COMPILER rc) -set(CMAKE_SYSTEM_PROCESSOR X86) \ No newline at end of file +set(CMAKE_C_COMPILER_TARGET i686-pc-windows-msvc) +set(CMAKE_CXX_COMPILER_TARGET i686-pc-windows-msvc) + +set(CMAKE_SYSTEM_PROCESSOR X86) + +# TODO: set the vcpkg target triplet perhaps? \ No newline at end of file diff --git a/cmake/llvm-win32-x86_64.cmake b/cmake/llvm-win32-x86_64.cmake index c26940aaa..7caeb7836 100644 --- a/cmake/llvm-win32-x86_64.cmake +++ b/cmake/llvm-win32-x86_64.cmake @@ -1,10 +1,30 @@ +# +# 86Box A hypervisor and IBM PC system emulator that specializes in +# running old operating systems and software designed for IBM +# PC systems and compatibles from 1981 through fairly recent +# system designs based on the PCI bus. +# +# This file is part of the 86Box distribution. +# +# CMake toolchain file for Clang on Windows builds (x64/AMD64 target). +# +# Authors: David Hrdlička, +# +# Copyright 2021 David Hrdlička. +# + include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc-x86_64.cmake) -set(CMAKE_C_COMPILER clang) -set(CMAKE_CXX_COMPILER clang++) -set(CMAKE_RC_COMPILER rc) +# Use the GCC-compatible Clang executables in order to use our flags +set(CMAKE_C_COMPILER clang) +set(CMAKE_CXX_COMPILER clang++) -set(CMAKE_C_COMPILER_TARGET x86_64-pc-windows-msvc) -set(CMAKE_CXX_COMPILER_TARGET x86_64-pc-windows-msvc) +# `llvm-rc` is barely usable as of LLVM 13, using MS' rc.exe for now +set(CMAKE_RC_COMPILER rc) -set(CMAKE_SYSTEM_PROCESSOR AMD64) \ No newline at end of file +set(CMAKE_C_COMPILER_TARGET x86_64-pc-windows-msvc) +set(CMAKE_CXX_COMPILER_TARGET x86_64-pc-windows-msvc) + +set(CMAKE_SYSTEM_PROCESSOR AMD64) + +# TODO: set the vcpkg target triplet perhaps? \ No newline at end of file