From ad1e1c5b2d5134e88456a2078f38fa207599171f Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Sat, 1 Sep 2018 20:06:10 +0200 Subject: cmake: pass linker flags, use devtoolset on centos 7 Change-Id: I8439fd070dc47a080e2df859c9f9ac67d8a08f04 Signed-off-by: Damjan Marion --- build-data/packages/vpp.mk | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/build-data/packages/vpp.mk b/build-data/packages/vpp.mk index 230f8904786..4002cbcf57f 100644 --- a/build-data/packages/vpp.mk +++ b/build-data/packages/vpp.mk @@ -52,16 +52,29 @@ vpp_configure_args += --enable-tests endif else +ifneq ($(shell which cmake3),) +CMAKE?=cmake3 +else +CMAKE?=cmake +endif + +vpp_cmake_args ?= +vpp_cmake_args += -DCMAKE_INSTALL_PREFIX:PATH=$(PACKAGE_INSTALL_DIR) +vpp_cmake_args += -DCMAKE_C_FLAGS="$($(TAG)_TAG_CFLAGS)" +vpp_cmake_args += -DCMAKE_LINKER_FLAGS="$($(TAG)_TAG_LDFLAGS)" +vpp_cmake_args += -DDPDK_INCLUDE_DIR_HINT="$(PACKAGE_INSTALL_DIR)/../dpdk/include" +vpp_cmake_args += -DDPDK_LIB_DIR_HINT="$(PACKAGE_INSTALL_DIR)/../dpdk/lib" + +# Use devtoolset on centos 7 +ifneq ($(wildcard /opt/rh/devtoolset-7/enable),) +vpp_cmake_args += -DCMAKE_PROGRAM_PATH:PATH="/opt/rh/devtoolset-7/root/bin" +endif + vpp_configure_depend += dpdk-install vpp_configure = \ cd $(PACKAGE_BUILD_DIR) && \ - cmake -G Ninja \ - -DCMAKE_INSTALL_PREFIX:PATH=$(PACKAGE_INSTALL_DIR) \ - -DCMAKE_C_FLAGS="$($(TAG)_TAG_CFLAGS)" \ - -DDPDK_INCLUDE_DIR_HINT="$(PACKAGE_INSTALL_DIR)/../dpdk/include" \ - -DDPDK_LIB_DIR_HINT="$(PACKAGE_INSTALL_DIR)/../dpdk/lib" \ - $(call find_source_fn,$(PACKAGE_SOURCE)) + $(CMAKE) -G Ninja $(vpp_cmake_args) $(call find_source_fn,$(PACKAGE_SOURCE)) #vpp_make_args = --no-print-directory -vpp_build = cmake --build $(PACKAGE_BUILD_DIR) -vpp_install = cmake --build $(PACKAGE_BUILD_DIR) -- install | grep -v 'Set runtime path' +vpp_build = $(CMAKE) --build $(PACKAGE_BUILD_DIR) +vpp_install = $(CMAKE) --build $(PACKAGE_BUILD_DIR) -- install | grep -v 'Set runtime path' endif -- cgit 1.2.3-korg