Skip to content

build: enable cctest to use generated objects

This commit tries to make it simpler to add unit tests (cctest) for code that needs to test node core funtionality but that might not be appropriate as an addon or a JavaScript test. An example of this could be adding functionality targeted for situations when Node itself is embedded.

Currently it was not as easy, or efficient, as one would have hoped to add such tests. The object output directories vary for different operating systems which we need to link to so that we don't have an additional compilation step.

Details of changes

move LIBS inside of --start-group --end-group

Currently the LIBS specified in the 'libraries' section are not being included in the --start-group --end-group section which means that these libraries will not be searched causing issue with linkers where the order matters.

add win specific paths for object files/libs

The OBJ_DIR on Windows seems to be Release\obj and all the object files get placed in Release\obj\node. This differs from the unix environments which specify the output object files using $@ which will include the path. I thought about updating this and use $(@f) to simply use the file name on unix and that way having all the object files in the same directory like it is done on windows, but that would mean a lot of changes to the gyp generator which I was not comfortable doing as part of this commit.

add paths specific to aix

On AIX the output directory for object files seems to be named 'node_base' and not 'node' causing a failure on AIX.

add include ldflag for solaris

It looks like when cctest is to be compiled the includes are missing. Added the SHARED_INTERMEDIATE_DIR as an include.

Refs: https://github.com/nodejs/node/pull/9163

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

build

Merge request reports

Loading