From 6eeb863feb79c0cf6c9f353ce05cae4e3d3fd583 Mon Sep 17 00:00:00 2001 From: Oleg Samarin Date: Fri, 29 Nov 2024 14:52:04 +0300 Subject: [PATCH] Elimenated clang compilation warnings "argument unused during compilation" https://github.com/GrandOrgue/grandorgue/issues/2001 (#2052) --- cmake/AddCpuOptions.cmake | 16 ++++++++++++++++ src/grandorgue/CMakeLists.txt | 8 +------- src/tests/CMakeLists.txt | 8 +------- src/tools/CMakeLists.txt | 10 ++-------- 4 files changed, 20 insertions(+), 22 deletions(-) create mode 100644 cmake/AddCpuOptions.cmake diff --git a/cmake/AddCpuOptions.cmake b/cmake/AddCpuOptions.cmake new file mode 100644 index 000000000..98626288e --- /dev/null +++ b/cmake/AddCpuOptions.cmake @@ -0,0 +1,16 @@ +# Copyright 2006 Milan Digital Audio LLC +# Copyright 2009-2024 GrandOrgue contributors (see AUTHORS) +# License GPL-2.0 or later +# (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html). + +include(${CMAKE_SOURCE_DIR}/cmake/AddCXXOption.cmake) + +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "x86") +add_cxx_option(-mmmx) +add_cxx_option(-msse) +add_cxx_option(-msse2) +add_cxx_option(-msse3) +endif() + +add_cxx_option(-mstackrealign) + diff --git a/src/grandorgue/CMakeLists.txt b/src/grandorgue/CMakeLists.txt index ba1b13a42..7043c3078 100644 --- a/src/grandorgue/CMakeLists.txt +++ b/src/grandorgue/CMakeLists.txt @@ -5,13 +5,7 @@ include(${CMAKE_SOURCE_DIR}/cmake/AddLinkerOption.cmake) include(${CMAKE_SOURCE_DIR}/cmake/CopyWxTranslations.cmake) include(${CMAKE_SOURCE_DIR}/cmake/CopyDependencies.cmake) - -add_option(-mmmx) -add_option(-msse) -add_option(-msse2) -add_option(-msse3) - -add_option(-mstackrealign) +include(${CMAKE_SOURCE_DIR}/cmake/AddCpuOptions.cmake) find_package(wxWidgets REQUIRED html net adv core base) include(${wxWidgets_USE_FILE}) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 3f033a133..eaeb72784 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -1,10 +1,4 @@ -add_option(-mmmx) -add_option(-msse) -add_option(-msse2) -add_option(-msse3) - -add_option(-mstackrealign) - +include(${CMAKE_SOURCE_DIR}/cmake/AddCpuOptions.cmake) include(UsewxWidgets) include_directories(${CMAKE_BINARY_DIR}/src/core/go_defs.h ${CMAKE_SOURCE_DIR}/src/core) diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 9e1aa027b..fb0d5d4c9 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -1,14 +1,8 @@ # Copyright 2006 Milan Digital Audio LLC -# Copyright 2009-2023 GrandOrgue contributors (see AUTHORS) +# Copyright 2009-2024 GrandOrgue contributors (see AUTHORS) # License GPL-2.0 or later (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html). -add_option(-mmmx) -add_option(-msse) -add_option(-msse2) -add_option(-msse3) - -add_option(-mstackrealign) - +include(${CMAKE_SOURCE_DIR}/cmake/AddCpuOptions.cmake) include(UsewxWidgets) include_directories(${CMAKE_BINARY_DIR}/src/core/go_defs.h ${CMAKE_SOURCE_DIR}/src/core)