summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2021-12-02 14:03:02 +0100
committerOle Tr�an <otroan@employees.org>2021-12-02 13:51:08 +0000
commitc30f3006bde0005962edf4cf84ca022b806b5ccf (patch)
tree21a2a12a7b011e91ae2de6cbed33c01b1cb673dc /src/CMakeLists.txt
parentefd6de87d3268f1ab499799cefb2e8b32a613f79 (diff)
build: bump min cmake version to 3.13 and remove workarounds
Type: make Change-Id: I1cd00257e132e671cbdd7b4710862afb07aa19e6 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a1764f73b18..46948a2aff3 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -11,7 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.13)
set(CMAKE_C_COMPILER_NAMES
clang-13
@@ -26,14 +26,6 @@ set(CMAKE_C_COMPILER_NAMES
project(vpp C)
-if(CMAKE_VERSION VERSION_LESS 3.12)
- macro(add_compile_definitions defs)
- foreach(d ${defs})
- add_compile_options(-D${d})
- endforeach()
- endmacro()
-endif()
-
if(NOT DEFINED CMAKE_INSTALL_LIBDIR AND EXISTS "/etc/debian_version")
set(CMAKE_INSTALL_LIBDIR "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
endif()
@@ -98,7 +90,7 @@ set(CMAKE_C_FLAGS_DEBUG "")
if (${CMAKE_BUILD_TYPE_LC} MATCHES "release")
add_compile_options(-O3 -fstack-protector -fno-common)
add_compile_definitions(_FORTIFY_SOURCE=2)
- set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-pie")
+ add_link_options("-pie")
elseif (${CMAKE_BUILD_TYPE_LC} MATCHES "debug")
add_compile_options(-O0 -fstack-protector -fno-common)
add_compile_definitions(CLIB_DEBUG)
@@ -143,8 +135,7 @@ set(VPP_SANITIZE_ADDR_OPTIONS
if (VPP_ENABLE_SANITIZE_ADDR)
add_compile_options(-fsanitize=address)
add_compile_definitions(CLIB_SANITIZE_ADDR)
- set(CMAKE_EXE_LINKER_FLAGS "-fsanitize=address ${CMAKE_EXE_LINKER_FLAGS}")
- set(CMAKE_SHARED_LINKER_FLAGS "-fsanitize=address ${CMAKE_SHARED_LINKER_FLAGS}")
+ add_link_options(-fsanitize=address)
endif (VPP_ENABLE_SANITIZE_ADDR)
##############################################################################