diff options
author | Jon Bratseth <bratseth@gmail.com> | 2021-09-27 07:08:36 +0000 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2021-09-27 07:08:36 +0000 |
commit | fe64026f259df982a7c5a5bdf093603dfb3e486d (patch) | |
tree | af2eb9124be1bcec9c359a8029ef1425eea3afdb /functions.cmake | |
parent | 4f0e63ee85a845b4b959bd70a9661b63cb590344 (diff) | |
parent | 9377da84086392e118d69b467006e73fe9ae3f70 (diff) |
Merge branch 'master' into bratseth/linguistics-components
Conflicts:
linguistics-components/src/main/resources/configdefinitions/sentence-piece.def
linguistics/src/main/resources/configdefinitions/language.sentencepiece.sentence-piece.def
linguistics/src/main/resources/configdefinitions/sentence-piece.def
Diffstat (limited to 'functions.cmake')
-rw-r--r-- | functions.cmake | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/functions.cmake b/functions.cmake index fe59cc3aaa9..3d192552be5 100644 --- a/functions.cmake +++ b/functions.cmake @@ -125,17 +125,13 @@ function(vespa_generate_config TARGET RELATIVE_CONFIG_DEF_PATH) get_filename_component(CONFIG_NAME ${RELATIVE_CONFIG_DEF_PATH} NAME_WE) endif() - # configgen.jar takes the parent dir of the destination dir and the destination dirname as separate parameters - # so it can produce the correct include statements within the generated .cpp-file (silent cry) # Make config path an absolute_path set(CONFIG_DEF_PATH ${CMAKE_CURRENT_LIST_DIR}/${RELATIVE_CONFIG_DEF_PATH}) - # Config destination is the + # Config destination is the current source directory (or parallel in build tree) + # configgen.jar takes the destination dirname as a property parameter set(CONFIG_DEST_DIR ${CMAKE_CURRENT_BINARY_DIR}) - # Get parent of destination directory - set(CONFIG_DEST_PARENT_DIR ${CONFIG_DEST_DIR}/..) - # Get destination dirname get_filename_component(CONFIG_DEST_DIRNAME ${CMAKE_CURRENT_BINARY_DIR} NAME) @@ -144,8 +140,8 @@ function(vespa_generate_config TARGET RELATIVE_CONFIG_DEF_PATH) add_custom_command( OUTPUT ${CONFIG_H_PATH} ${CONFIG_CPP_PATH} - COMMAND java -Dconfig.spec=${CONFIG_DEF_PATH} -Dconfig.dest=${CONFIG_DEST_PARENT_DIR} -Dconfig.lang=cpp -Dconfig.subdir=${CONFIG_DEST_DIRNAME} -Dconfig.dumpTree=false -Xms64m -Xmx64m -jar ${PROJECT_SOURCE_DIR}/configgen/target/configgen.jar - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/.. + COMMAND java -Dconfig.spec=${CONFIG_DEF_PATH} -Dconfig.dest=${CONFIG_DEST_DIR} -Dconfig.lang=cpp -Dconfig.dumpTree=false -Xms64m -Xmx64m -jar ${PROJECT_SOURCE_DIR}/configgen/target/configgen.jar + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Generating cpp config for ${CONFIG_NAME} in ${CMAKE_CURRENT_SOURCE_DIR}" MAIN_DEPENDENCY ${CONFIG_DEF_PATH} ) @@ -157,11 +153,6 @@ function(vespa_generate_config TARGET RELATIVE_CONFIG_DEF_PATH) # Add generated to sources for target target_sources(${TARGET} PRIVATE ${CONFIG_H_PATH} ${CONFIG_CPP_PATH}) - # Needed to be able to do a #include <CONFIG_DEST_DIRNAME/config-<name>.h> for this target - # This is used within the generated config-<name>.cpp - # TODO: Should modify configgen to use #include <vespa/<modulename>/config-<name>.h> instead - target_include_directories(${TARGET} PRIVATE ${CONFIG_DEST_PARENT_DIR}) - # Needed to be able to do a #include <config-<name>.h> for this target # This is used within some unit tests target_include_directories(${TARGET} PRIVATE ${CONFIG_DEST_DIR}) |