1From d4d6b138d727e484fa9d0fef476ca181681d0695 Mon Sep 17 00:00:00 2001
2From: Wilfred Mallawa <wilfred.mallawa@wdc.com>
3Date: Mon, 19 Feb 2024 09:56:14 +1000
4Subject: [PATCH] CMakeLists: remove fixed options for NONE
5
6The use of the NONE toolchain option is such that we can provide at the
7build project level (buildroot etc...). However, the changes introduced
8in 811f2b596def04b3a36368cf2098546d7907767f set certain compiler/linker
9option that does not comply with the definition of the options as
10specified in [1]. This change removes those options.
11
12[1] https://github.com/DMTF/libspdm/blob/main/doc/build.md#linux-builds-inside-build-environments
13
14Upstream: https://github.com/DMTF/libspdm/commit/d4d6b138d727e484fa9d0fef476ca181681d0695
15Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
16---
17 CMakeLists.txt | 19 -------------------
18 1 file changed, 19 deletions(-)
19
20diff --git a/CMakeLists.txt b/CMakeLists.txt
21index 9c300cc817..f6cf17d269 100644
22--- a/CMakeLists.txt
23+++ b/CMakeLists.txt
24@@ -618,25 +618,6 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
25         SET(CMAKE_EXE_LINKER_FLAGS "")
26
27         SET(CMAKE_C_LINK_EXECUTABLE "")
28-
29-    elseif(TOOLCHAIN STREQUAL "NONE")
30-        ADD_COMPILE_OPTIONS(-fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -fno-common -Wno-address -fpie -fno-asynchronous-unwind-tables -flto -DUSING_LTO  -Wno-maybe-uninitialized -Wno-uninitialized  -Wno-builtin-declaration-mismatch -Wno-nonnull-compare -Werror-implicit-function-declaration)
31-        if(CMAKE_BUILD_TYPE STREQUAL "Debug")
32-            ADD_COMPILE_OPTIONS(-g)
33-        endif()
34-        if(GCOV STREQUAL "ON")
35-        ADD_COMPILE_OPTIONS(--coverage -fprofile-arcs -ftest-coverage)
36-        endif()
37-        SET(OPENSSL_FLAGS -include base.h -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -Wno-error=unused-but-set-variable -Wno-cast-qual -Wno-error=implicit-function-declaration)
38-        SET(CMOCKA_FLAGS -std=gnu99 -Wpedantic -Wall -Wshadow -Wmissing-prototypes -Wcast-align -Werror=address -Wstrict-prototypes -Werror=strict-prototypes -Wwrite-strings -Werror=write-strings -Werror-implicit-function-declaration -Wpointer-arith -Werror=pointer-arith -Wdeclaration-after-statement -Werror=declaration-after-statement -Wreturn-type -Werror=return-type -Wuninitialized -Werror=uninitialized -Werror=strict-overflow -Wstrict-overflow=2 -Wno-format-zero-length -Wmissing-field-initializers -Wformat-security -Werror=format-security -fno-common -Wformat -fno-common -fstack-protector-strong -Wno-cast-qual)
39-
40-        SET(CMAKE_LINKER ${CMAKE_C_COMPILER})
41-        SET(CMAKE_EXE_LINKER_FLAGS "-flto -Wno-error -no-pie" )
42-        if(GCOV STREQUAL "ON")
43-        SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}  --coverage -lgcov -fprofile-arcs -ftest-coverage")
44-        endif()
45-        SET(CMAKE_C_LINK_EXECUTABLE "<CMAKE_LINKER> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -Wl,--start-group <LINK_LIBRARIES> -Wl,--end-group")
46-
47     endif()
48
49     if(NOT TOOLCHAIN STREQUAL "NIOS2_GCC")
50--
512.43.2
52
53