https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d4719197b273bd135d017…
commit d4719197b273bd135d017915f2196dad1edf7842
Author: William Kent <wjk011(a)gmail.com>
AuthorDate: Sat Oct 19 15:15:31 2024 -0400
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Oct 19 12:15:31 2024 -0700
[MKISOFS] Fix Clang check for macOS platforms (#7037)
* [MKISOFS] Fix Clang check for macOS platforms
On macOS, CMAKE_C_COMPILER_ID is "AppleClang". While certainly Clang,
this does not match the exact string "Clang" that is being checked for,
and as a result the warning flags guarded thereby are not passed to the
compiler. With this change CMake will recognize both Clang and AppleClang.
* Update sdk/tools/mkisofs/CMakeLists.txt
---
sdk/tools/mkisofs/CMakeLists.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sdk/tools/mkisofs/CMakeLists.txt b/sdk/tools/mkisofs/CMakeLists.txt
index 1b4c2116035..840e837f611 100644
--- a/sdk/tools/mkisofs/CMakeLists.txt
+++ b/sdk/tools/mkisofs/CMakeLists.txt
@@ -107,7 +107,8 @@ else()
# Silence compilers checking for invalid formatting sequences.
target_compile_options(libschily PRIVATE "-Wno-format")
- if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "15")
+ # MATCHES must be used here because on macOS, CMake uses the compiler ID "AppleClang".
+ if(CMAKE_C_COMPILER_ID MATCHES "Clang$" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "15")
# mkisofs uses K&R-style function definitions to support very old compilers.
# This causes warnings with modern compilers.
target_compile_options(libmdigest PRIVATE "-Wno-deprecated-non-prototype")
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fd265bd7ac5185dc297d4…
commit fd265bd7ac5185dc297d404cc6c2d7b53e670053
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Fri Oct 18 10:23:31 2024 +0300
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Sat Oct 19 15:11:44 2024 +0300
[CMAKE] Enable proper definition of __cplusplus macro on MSVC
MSVC defaults to always reporting 199711L to satisfy broken C++ code. You have to add a command line argument to make it work correctly. See https://learn.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msv…
---
sdk/cmake/msvc.cmake | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sdk/cmake/msvc.cmake b/sdk/cmake/msvc.cmake
index 67c2e451d7b..bf804dd3bfd 100644
--- a/sdk/cmake/msvc.cmake
+++ b/sdk/cmake/msvc.cmake
@@ -32,6 +32,9 @@ endif()
add_definitions(/D__STDC__=1)
+# Enable correct values of __cplusplus macro for newer standards
+add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/Zc:__cplusplus>)
+
# Ignore any "standard" include paths, and do not use any default CRT library.
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
add_compile_options(/X /Zl)