Skip to content

Commit

Permalink
Fix _FORTIFY_SOURCE warning treated as error
Browse files Browse the repository at this point in the history
This commit adds -O3 to the CMakeLists.txt of the omrtrace component to
prevent the following warning treated as an error:

warning _FORTIFY_SOURCE requires compiling with optimization (-O)

Signed-off-by: Irwin D'Souza <[email protected]>
  • Loading branch information
dsouzai committed Sep 12, 2022
1 parent 6b94384 commit 63ab1bc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion omrtrace/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2017, 2020 IBM Corp. and others
# Copyright (c) 2017, 2022 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -36,6 +36,9 @@ omr_add_library(omrtrace STATIC
# to implement variable length structs
if (OMR_STRNCPY_FORTIFY_OPTIONS)
target_compile_options(omrtrace PRIVATE ${OMR_STRNCPY_FORTIFY_OPTIONS})
if (OMR_OS_LINUX)
target_compile_options(omrtrace PRIVATE -O3)
endif()
endif()

target_link_libraries(omrtrace
Expand Down

0 comments on commit 63ab1bc

Please sign in to comment.