From 79b259851fd680470c3b8b3226ad260e399ecfb0 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Fri, 30 Apr 2021 03:14:02 -0400 Subject: [PATCH] Version check on gcc compiler moved to CMakeLists.txt --- CMakeLists.txt | 6 ++++++ src/Audacity.h | 9 --------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cf35bbb2c..f54bdf985 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,12 @@ # generator expressions. cmake_minimum_required( VERSION 3.15 ) +# If building with GNU compiler, then must be 4.9 or later. +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND + CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9") + message(FATAL_ERROR "Audacity requires at least GCC 4.9") +endif () + # Don't allow in-source builds...no real reason, just # keeping those source trees nice and tidy. :-) # (This can be removed if it becomes an issue.) diff --git a/src/Audacity.h b/src/Audacity.h index 28bd22062..b73832aba 100644 --- a/src/Audacity.h +++ b/src/Audacity.h @@ -24,15 +24,6 @@ #ifndef __AUDACITY_H__ #define __AUDACITY_H__ -// If building with GNU compiler, then must be 4.9 or later. -// TODO: This would be much nicer as a standalone test in configure.ac -#if !defined(__APPLE__) && !defined(__clang__) && \ - defined __GNUC__ && ( __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 9)) - - #error Audacity requires at least GCC 4.9 -#endif - - // We only do alpha builds, beta builds, and release versions. // Most of the time we're in development, so AUDACITY_BUILD_LEVEL should be // defined to 0.