Merge lp:~zorba-coders/zorba/module-depends into lp:zorba

Proposed by David Graf
Status: Merged
Approved by: David Graf
Approved revision: 11106
Merged at revision: 11115
Proposed branch: lp:~zorba-coders/zorba/module-depends
Merge into: lp:zorba
Diff against target: 32 lines (+7/-1)
1 file modified
cmake_modules/ZorbaModule.cmake (+7/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/module-depends
Reviewer Review Type Date Requested Status
Chris Hillery Approve
Till Westmann Approve
David Graf (community) Approve
Review via email: mp+130784@code.launchpad.net

Commit message

Additional optional parameter for DECLARE_ZORBA_MODULE macro to pass targets the declared module depends on.

Description of the change

Additional optional parameter for DECLARE_ZORBA_MODULE macro to pass targets the declared module depends on.

To post a comment you must log in.
Revision history for this message
David Graf (davidagraf) wrote :

Till, this changed is needed for 28msec. Our mongodb module is dependent on one of our targets.

Revision history for this message
David Graf (davidagraf) :
review: Approve
Revision history for this message
Till Westmann (tillw) wrote :

Looks good to me. Added Chris as the master of all Zorba CMake files as a reviewer.

review: Approve
Revision history for this message
Chris Hillery (ceejatec) wrote :

As written, DEPENDS will only do anything if the module includes C++ code. If that is sufficient for your needs, fine, but please change the name of the parameter to something like LIBRARY_DEPENDS to make this clear.

If you need to have targets executed for modules that do NOT have C++ code, then you may be able to make use of the fifth argument to ADD_COPY_RULE(). However, if you go this route, test it *extensively*; adding target dependencies to CMake custom commands (which is necessary for that to work) often leads to really erratic and frustrating CMake behaviour. It won't even have a chance to work on CMake prior to version 2.8.4, either. I do something similar for DECLARE_ZORBA_JAR(), but it has caused no end of grief and I'm not completely sure it's working right all the time even now.

review: Needs Fixing
Revision history for this message
David Graf (davidagraf) wrote :

We need the feature to make a module dependent on some header file generation done with zorba. Is the renaming like this ok?

Revision history for this message
Chris Hillery (ceejatec) wrote :

No, this naming (and the header comment) still does not convey that this feature is only functional for modules with C++ code. I don't want anyone writing a pure XQuery module to think that this will work for them, because it won't.

I still suggestion something like:

# LIBRARY_DEPENDS - (optional) A list of targets which the external function library will depend on

It's not a great name, but it at least relates it to the LINK_LIBRARIES option which is also only relevant for external function libraries.

Revision history for this message
David Graf (davidagraf) wrote :

chris, is it ok like this?

Revision history for this message
Chris Hillery (ceejatec) wrote :

Looks like maybe you had a search-and-replace problem. The arguments to PARSE_ARGUMENTS are semicolon-separated, not space-separated, and the constructed variable would be named ${MODULE_LIBRARY_DEPENDS}, not ${MODULE LIBRARY_DEPENDS}.

I've corrected those problems and also expanded the comment for the new parameter. I'm assuming that you have tested the earlier code in Sausalito and that it actually does what you need it to do, so I'll go ahead and vote Approve. If you are OK with my changes, go ahead and mark the proposal Approved to hopefully get it merged.

review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/module-depends into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job module-depends-2012-10-30T09-34-54.144Z is finished.
  The final status was:

  1 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
David Graf (davidagraf) wrote :

the failing test works on my machine. Seems to be a timeout. I try again ..

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job module-depends-2012-10-30T10-13-48.213Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cmake_modules/ZorbaModule.cmake'
2--- cmake_modules/ZorbaModule.cmake 2012-10-08 12:09:36 +0000
3+++ cmake_modules/ZorbaModule.cmake 2012-10-30 08:55:24 +0000
4@@ -118,6 +118,9 @@
5 # information; see below
6 # TEST_ONLY - (optional) Module is for testcases only and should not
7 # be installed
8+# LIBRARY_DEPENDS - (optional) List of targets that the external
9+# function library will depend on (only works if the module
10+# contains C++ external functions)
11 #
12 # CONFIG_FILES - any files specific here will be copied to
13 # CMAKE_CURRENT_BINARY_DIR using CONFIGURE_FILE(). They may contain
14@@ -136,7 +139,7 @@
15 # file enough to deduce the URI and version?
16 MACRO (DECLARE_ZORBA_MODULE)
17 # Parse and validate arguments
18- PARSE_ARGUMENTS(MODULE "LINK_LIBRARIES;EXTRA_SOURCES;CONFIG_FILES"
19+ PARSE_ARGUMENTS(MODULE "LINK_LIBRARIES;EXTRA_SOURCES;CONFIG_FILES;LIBRARY_DEPENDS"
20 "URI;FILE;VERSION" "TEST_ONLY" ${ARGN})
21 IF (NOT MODULE_FILE)
22 MESSAGE (FATAL_ERROR "'FILE' argument is required for ZORBA_DECLARE_MODULE()")
23@@ -268,6 +271,9 @@
24 # the module *URI*'s final component.
25 SET(module_lib_target "modlib${num_zorba_modules}_${module_name}")
26 ADD_LIBRARY(${module_lib_target} SHARED ${SRC_FILES})
27+ IF (MODULE_LIBRARY_DEPENDS)
28+ ADD_DEPENDENCIES(${module_lib_target} ${MODULE_LIBRARY_DEPENDS})
29+ ENDIF()
30 GET_FILENAME_COMPONENT(module_filewe "${module_filename}" NAME_WE)
31 IF (MODULE_VERSION)
32 # If there's a version, insert it into the module library name

Subscribers

People subscribed via source and target branches