Skip to content

Commit

Permalink
CMakeLists: remove fixed options for NONE
Browse files Browse the repository at this point in the history
The use of the NONE toolchain option is such that we can provide at the
build project level (buildroot etc...). However, the changes introduced
in 811f2b5 set certain compiler/linker
option that does not comply with the definition of the options as
specified in [1]. This change removes those options.

[1] https://github.com/DMTF/libspdm/blob/main/doc/build.md#linux-builds-inside-build-environments

Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
  • Loading branch information
twilfredo authored and steven-bellock committed Feb 20, 2024
1 parent 7046368 commit d4d6b13
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -618,25 +618,6 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
SET(CMAKE_EXE_LINKER_FLAGS "")

SET(CMAKE_C_LINK_EXECUTABLE "")

elseif(TOOLCHAIN STREQUAL "NONE")
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)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
ADD_COMPILE_OPTIONS(-g)
endif()
if(GCOV STREQUAL "ON")
ADD_COMPILE_OPTIONS(--coverage -fprofile-arcs -ftest-coverage)
endif()
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)
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)

SET(CMAKE_LINKER ${CMAKE_C_COMPILER})
SET(CMAKE_EXE_LINKER_FLAGS "-flto -Wno-error -no-pie" )
if(GCOV STREQUAL "ON")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage -lgcov -fprofile-arcs -ftest-coverage")
endif()
SET(CMAKE_C_LINK_EXECUTABLE "<CMAKE_LINKER> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -Wl,--start-group <LINK_LIBRARIES> -Wl,--end-group")

endif()

if(NOT TOOLCHAIN STREQUAL "NIOS2_GCC")
Expand Down

0 comments on commit d4d6b13

Please sign in to comment.