-
Notifications
You must be signed in to change notification settings - Fork 655
testing/cmocka: Compile cmocka as a libary only by default #3270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Build is failing because sim:citest needs the change in apache/nuttx#17653 |
This commit introduces a Kconfig switch to include the cmocka binary built from cmocka_main.c. The default behaviour is now changed so that cmocka is built as a library only, which would be the desired behaviour for users creating their own cmocka projects. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
a9e2457 to
ffea164
Compare
| # | ||
|
|
||
| config TESTING_CMOCKA | ||
| tristate "Enable libcmocka" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| bool "Enable libcmocka" |
| if TESTING_CMOCKA | ||
|
|
||
| config TESTING_CMOCKA_PROG | ||
| bool "Compile cmocka binary" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| bool "Compile cmocka binary" | |
| tristate "Compile cmocka binary" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come tristate should be used here? Is it because of the MODULE variable in Makefile?
| CFLAGS += -DHAVE_STRUCT_TIMESPEC=1 | ||
| CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/testing/cmocka | ||
|
|
||
| MODULE = $(CONFIG_TESTING_CMOCKA) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| MODULE = $(CONFIG_TESTING_CMOCKA) | |
| MODULE = $(CONFIG_TESTING_CMOCKA_PROG) |
|
|
||
| MODULE = $(CONFIG_TESTING_CMOCKA) | ||
|
|
||
| ifeq ($(CONFIG_TESTING_CMOCKA_PROG),y) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ifeq ($(CONFIG_TESTING_CMOCKA_PROG),y) | |
| ifneq ($(CONFIG_TESTING_CMOCKA_PROG),) |
Summary
This commit introduces a Kconfig switch to include the cmocka binary built from cmocka_main.c. The default behaviour is now changed so that cmocka is built as a library only, which would be the desired behaviour for users creating their own cmocka projects.
Impact
Cmocka is now only built as a library, so the
cmockabinary is no longerincluded by default.
PR (apache/nuttx#17653) to the NuttX kernel preserves the compilation of the
cmockabinary for the two existing defconfigs which use the cmocka application.Testing
Compilation of the cmocka libary without the binary using
sim:nshas a basis:Then, when disabling
CONFIG_TESTING_CMOCKA_ASLIB, the compilation is:and I can run the cmocka application on sim: