build: bump min cmake version to 3.13 and remove workarounds
Type: make
Change-Id: I1cd00257e132e671cbdd7b4710862afb07aa19e6
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a1764f7..46948a2 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 @@
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 @@
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 @@
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)
##############################################################################