diff --git a/Modules/Platform/Apple-Clang.cmake b/Modules/Platform/Apple-Clang.cmake index 70fc75e9d5..0681bfb059 100644 --- a/Modules/Platform/Apple-Clang.cmake +++ b/Modules/Platform/Apple-Clang.cmake @@ -3,10 +3,7 @@ # This module is shared by multiple languages; use include blocker. -if(__APPLE_COMPILER_CLANG) - return() -endif() -set(__APPLE_COMPILER_CLANG 1) +include_guard() macro(__apple_compiler_clang lang) set(CMAKE_${lang}_VERBOSE_FLAG "-v -Wl,-v") # also tell linker to print verbose output diff --git a/Modules/Platform/Apple-GNU.cmake b/Modules/Platform/Apple-GNU.cmake index 9985dddd7d..0eb8168310 100644 --- a/Modules/Platform/Apple-GNU.cmake +++ b/Modules/Platform/Apple-GNU.cmake @@ -3,10 +3,7 @@ # This module is shared by multiple languages; use include blocker. -if(__APPLE_COMPILER_GNU) - return() -endif() -set(__APPLE_COMPILER_GNU 1) +include_guard() macro(__apple_compiler_gnu lang) set(CMAKE_${lang}_VERBOSE_FLAG "-v -Wl,-v") # also tell linker to print verbose output diff --git a/Modules/Platform/Apple-Intel.cmake b/Modules/Platform/Apple-Intel.cmake index 9f92d9592a..2d4f7e5917 100644 --- a/Modules/Platform/Apple-Intel.cmake +++ b/Modules/Platform/Apple-Intel.cmake @@ -3,10 +3,7 @@ # This module is shared by multiple languages; use include blocker. -if(__APPLE_COMPILER_INTEL) - return() -endif() -set(__APPLE_COMPILER_INTEL 1) +include_guard() macro(__apple_compiler_intel lang) set(CMAKE_${lang}_VERBOSE_FLAG "-v -Wl,-v") # also tell linker to print verbose output diff --git a/Modules/Platform/Apple-PGI.cmake b/Modules/Platform/Apple-PGI.cmake index a68c08dea7..8d343b7d16 100644 --- a/Modules/Platform/Apple-PGI.cmake +++ b/Modules/Platform/Apple-PGI.cmake @@ -2,10 +2,7 @@ # file Copyright.txt or https://cmake.org/licensing for details. # This module is shared by multiple languages; use include blocker. -if(__APPLE_COMPILER_PGI) - return() -endif() -set(__APPLE_COMPILER_PGI 1) +include_guard() macro(__apple_compiler_pgi lang) set(CMAKE_${lang}_OSX_COMPATIBILITY_VERSION_FLAG "-Wl,-compatibility_version,")