Skip to content

Commit 7a07239

Browse files
committed
SWPROT-8953: Disable Werror on UnifySDK dep release
As explain in patch it is good to use Werror in devel or ci branch not in releases (tags). This change is not yet applied upstream, to support more compilers, issue has been reported on OSX using ``` ➜ ~ cc --version Apple clang version 15.0.0 (clang-1500.3.9.4) Target: x86_64-apple-darwin23.4.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin ➜ ~ c++ --version Apple clang version 15.0.0 (clang-1500.3.9.4) Target: x86_64-apple-darwin23.4.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin ``` I would be nice to fix this in the upstream too: .../unifysdk-src/components/uic_main/src/uic_init.c:77:21: \ error: passing arguments to 'sl_log_read_config' \ without a prototype is deprecated in all versions of C \ and is not supported in C2x \ [-Werror,-Wdeprecated-non-prototype] sl_log_read_config(NULL); Origin: #25 Signed-off-by: Philippe Coval <[email protected]>
1 parent 8d284db commit 7a07239

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

cmake/modules/FindUnifySDK.cmake

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,25 @@ if("${UNIFYSDK_GIT_TAG}" STREQUAL "")
2727
set(UNIFYSDK_GIT_TAG "main") # Override CMake default ("master")
2828
endif()
2929

30+
if(${GIT_EXECUTABLE})
31+
else()
32+
set(GIT_EXECUTABLE git)
33+
endif()
34+
3035
FetchContent_Declare(
3136
UnifySDK
3237
GIT_REPOSITORY ${UNIFYSDK_GIT_REPOSITORY}
3338
GIT_TAG ${UNIFYSDK_GIT_TAG}
3439
GIT_SUBMODULES_RECURSE True
3540
GIT_SHALLOW 1
41+
42+
# Prevent "fatal: unable to auto-detect email address"
43+
GIT_CONFIG [email protected]
44+
45+
PATCH_COMMAND ${GIT_EXECUTABLE}
46+
-C <SOURCE_DIR>
47+
am
48+
${PROJECT_SOURCE_DIR}/patches/UnifySDK/0001-UIC-3202-Relax-compiler-warnings-to-support-more-com.patch
3649
)
3750

3851
message(STATUS "${CMAKE_PROJECT_NAME}: Depends: ${UNIFYSDK_GIT_REPOSITORY}#${UNIFYSDK_GIT_TAG}")
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
From 9e212f8578e945598096b90e18b91a662d5f98e6 Mon Sep 17 00:00:00 2001
2+
From: Philippe Coval <[email protected]>
3+
Date: Tue, 23 Jan 2024 16:27:50 +0100
4+
Subject: [PATCH] UIC-3202: Relax compiler warnings to support more compilers
5+
6+
Threating warning as error is a good practice durring development phase,
7+
for release it's ok to relax this to support more (future) compilers
8+
and then provide best effort support on non supported environements.
9+
10+
For instance we might allow users to support stable version of gcc
11+
(gcc-13 currently which is not yet enabled in our CI)
12+
13+
Of course this change should be reverted on development branch, ASAP,
14+
and introduced again for next releases.
15+
16+
Ideally it should be near to release tags.
17+
18+
Origin: uic/pull-requests/2704/overview
19+
Relate-to: uic/pull-requests/2705/overview?commentId=796680
20+
Relate-to: /x/FND4Dg#BrainstormItems-Identifystandardsbreakage
21+
Forwarded: uic/pull-requests/2704/overview
22+
Signed-off-by: Philippe Coval <[email protected]>
23+
---
24+
cmake/include/compiler_options.cmake | 4 ++--
25+
1 file changed, 2 insertions(+), 2 deletions(-)
26+
27+
diff --git a/cmake/include/compiler_options.cmake b/cmake/include/compiler_options.cmake
28+
index 751ffe84bd..1f83caa008 100644
29+
--- a/cmake/include/compiler_options.cmake
30+
+++ b/cmake/include/compiler_options.cmake
31+
@@ -31,8 +31,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # Do not allow fallback to previous C++
32+
set(CMAKE_CXX_EXTENSIONS ON) # Enable gnu++11 extentions
33+
34+
# Set compiler Flags
35+
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -Werror -Wall")
36+
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -Werror -Wall")
37+
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -Wall")
38+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -Wall")
39+
40+
# Only add code coverage when CMAKE_GCOV is True
41+
if(CMAKE_GCOV)
42+
--
43+
2.39.5
44+

0 commit comments

Comments
 (0)