From 8a2977ba55367c91f2f66055ea2cc1304e1a42b1 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 29 Sep 2020 08:24:27 -0700 Subject: OBJCXX: Fix regression for compiling cpp files as objcxx In commit 8d61294c3e (PCH: Mark CMake PCH source files as -x -header, 2020-09-04, v3.18.3~14^2) we removed the explicit `-x objective-c++` flag. This broke cases with custom source extensions. Restore the explicit `-x objective-c[++]` flag and put it before the `` placeholder. The latter will contain the proper `-x objective-c[++]-header` value and will override the `-x objective-c[++]` value set before. Fixes: #21234 --- Modules/CMakeOBJCInformation.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Modules/CMakeOBJCInformation.cmake') diff --git a/Modules/CMakeOBJCInformation.cmake b/Modules/CMakeOBJCInformation.cmake index b3da82d59e..d530191753 100644 --- a/Modules/CMakeOBJCInformation.cmake +++ b/Modules/CMakeOBJCInformation.cmake @@ -170,7 +170,7 @@ endif() # compile an Objective-C file into an object file if(NOT CMAKE_OBJC_COMPILE_OBJECT) set(CMAKE_OBJC_COMPILE_OBJECT - " -x objective-c -o -c ") + " -x objective-c -o -c ") endif() if(NOT CMAKE_OBJC_LINK_EXECUTABLE) -- cgit v1.2.1