summaryrefslogtreecommitdiffstats
path: root/build-data
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-09-01 20:06:10 +0200
committerDamjan Marion <damarion@cisco.com>2018-09-01 20:06:50 +0200
commitad1e1c5b2d5134e88456a2078f38fa207599171f (patch)
treea71e3b956c4351d86f03cc86a5f96349b12d846b /build-data
parentc6c0246e2e9219baee3d67970775bed7560eac1e (diff)
cmake: pass linker flags, use devtoolset on centos 7
Change-Id: I8439fd070dc47a080e2df859c9f9ac67d8a08f04 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'build-data')
-rw-r--r--build-data/packages/vpp.mk29
1 files 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