xref: /OK3568_Linux_fs/buildroot/package/open62541/open62541.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun################################################################################
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# open62541
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun################################################################################
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunOPEN62541_VERSION = v1.2.2
8*4882a593SmuzhiyunOPEN62541_SITE_METHOD = git
9*4882a593SmuzhiyunOPEN62541_SITE = https://github.com/open62541/open62541.git
10*4882a593SmuzhiyunOPEN62541_GIT_SUBMODULES = YES
11*4882a593SmuzhiyunOPEN62541_INSTALL_STAGING = YES
12*4882a593SmuzhiyunOPEN62541_LICENSE = MPL-2.0
13*4882a593SmuzhiyunOPEN62541_LICENSE_FILES = LICENSE
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun# Force Release build to remove -Werror.
16*4882a593Smuzhiyun# Don't use git describe to get the version number.
17*4882a593Smuzhiyun# Disable hardening options to let Buildroot handle it.
18*4882a593SmuzhiyunOPEN62541_CONF_OPTS = \
19*4882a593Smuzhiyun	-DCMAKE_BUILD_TYPE=Release \
20*4882a593Smuzhiyun	-DGIT_EXECUTABLE=NO \
21*4882a593Smuzhiyun	-DOPEN62541_VERSION=$(OPEN62541_VERSION) \
22*4882a593Smuzhiyun	-DUA_ENABLE_HARDENING=OFF \
23*4882a593Smuzhiyun	-DUA_FORCE_WERROR=OFF
24*4882a593Smuzhiyun
25*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_OPEN62541_UA_NAMESPACE_ZERO_MINIMAL),y)
26*4882a593SmuzhiyunOPEN62541_CONF_OPTS += -DUA_NAMESPACE_ZERO=MINIMAL
27*4882a593Smuzhiyunelse ifeq ($(BR2_PACKAGE_OPEN62541_UA_NAMESPACE_ZERO_REDUCED),y)
28*4882a593SmuzhiyunOPEN62541_CONF_OPTS += -DUA_NAMESPACE_ZERO=REDUCED
29*4882a593Smuzhiyunelse ifeq ($(BR2_PACKAGE_OPEN62541_UA_NAMESPACE_ZERO_FULL),y)
30*4882a593SmuzhiyunOPEN62541_CONF_OPTS += -DUA_NAMESPACE_ZERO=FULL
31*4882a593Smuzhiyunendif
32*4882a593Smuzhiyun
33*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_OPEN62541_JSON_ENCODING),y)
34*4882a593SmuzhiyunOPEN62541_CONF_OPTS += -DUA_ENABLE_JSON_ENCODING=ON
35*4882a593Smuzhiyunelse
36*4882a593SmuzhiyunOPEN62541_CONF_OPTS += -DUA_ENABLE_JSON_ENCODING=OFF
37*4882a593Smuzhiyunendif
38*4882a593Smuzhiyun
39*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_OPEN62541_PUBSUB),y)
40*4882a593SmuzhiyunOPEN62541_CONF_OPTS += -DUA_ENABLE_PUBSUB=ON
41*4882a593Smuzhiyunelse
42*4882a593SmuzhiyunOPEN62541_CONF_OPTS += -DUA_ENABLE_PUBSUB=OFF
43*4882a593Smuzhiyunendif
44*4882a593Smuzhiyun
45*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_OPEN62541_PUBSUB_DELTAFRAMES),y)
46*4882a593SmuzhiyunOPEN62541_CONF_OPTS += -DUA_ENABLE_PUBSUB_DELTAFRAMES=ON
47*4882a593Smuzhiyunelse
48*4882a593SmuzhiyunOPEN62541_CONF_OPTS += -DUA_ENABLE_PUBSUB_DELTAFRAMES=OFF
49*4882a593Smuzhiyunendif
50*4882a593Smuzhiyun
51*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_OPEN62541_PUBSUB_INFORMATIONMODEL),y)
52*4882a593SmuzhiyunOPEN62541_CONF_OPTS += -DUA_ENABLE_PUBSUB_INFORMATIONMODEL=ON
53*4882a593Smuzhiyunelse
54*4882a593SmuzhiyunOPEN62541_CONF_OPTS += -DUA_ENABLE_PUBSUB_INFORMATIONMODEL=OFF
55*4882a593Smuzhiyunendif
56*4882a593Smuzhiyun
57*4882a593Smuzhiyun# Remove unneeded files
58*4882a593Smuzhiyundefine OPEN62541_REMOVE_UNNEEDED_FILES
59*4882a593Smuzhiyun	$(RM) -r $(TARGET_DIR)/usr/share/open62541
60*4882a593Smuzhiyunendef
61*4882a593Smuzhiyun
62*4882a593SmuzhiyunOPEN62541_POST_INSTALL_TARGET_HOOKS += OPEN62541_REMOVE_UNNEEDED_FILES
63*4882a593Smuzhiyun
64*4882a593Smuzhiyun$(eval $(cmake-package))
65