Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Gaudi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Valentin Volkl
Gaudi
Commits
5bf6375d
Commit
5bf6375d
authored
2 years ago
by
Marco Clemencic
Browse files
Options
Downloads
Patches
Plain Diff
Make sure on Mac we always produce a .confdb2 and a .confdb2.db
parent
da0230fd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GaudiKernel/scripts/merge_confdb2_parts
+7
-0
7 additions, 0 deletions
GaudiKernel/scripts/merge_confdb2_parts
cmake/GaudiToolbox.cmake
+24
-6
24 additions, 6 deletions
cmake/GaudiToolbox.cmake
with
31 additions
and
6 deletions
GaudiKernel/scripts/merge_confdb2_parts
+
7
−
0
View file @
5bf6375d
...
...
@@ -60,11 +60,18 @@ if __name__ == "__main__":
logging
.
debug
(
"
opening %r for writing
"
,
output
)
if
os
.
path
.
exists
(
output
):
os
.
remove
(
output
)
if
sys
.
platform
.
startswith
(
"
darwin
"
)
and
os
.
path
.
exists
(
output
+
"
.db
"
):
os
.
remove
(
output
+
"
.db
"
)
out
=
shelve
.
open
(
output
)
for
input
in
inputs
:
logging
.
debug
(
"
adding %r
"
,
input
)
out
.
update
(
eval
(
open
(
input
,
"
rb
"
).
read
()))
out
.
close
()
if
sys
.
platform
.
startswith
(
"
darwin
"
):
if
os
.
path
.
exists
(
output
):
# this Python uses dbm.gnu
open
(
output
+
"
.db
"
,
"
w
"
)
# make a dummy ".db" version
elif
os
.
path
.
exists
(
output
+
"
.db
"
):
# this Python uses dbm.ndbm
open
(
output
,
"
w
"
)
# make a dummy version without the artificial ".db"
except
:
if
os
.
path
.
exists
(
output
):
os
.
remove
(
output
)
...
...
This diff is collapsed.
Click to expand it.
cmake/GaudiToolbox.cmake
+
24
−
6
View file @
5bf6375d
...
...
@@ -451,11 +451,7 @@ function(gaudi_add_module plugin_name)
${
_gaudi_install_optional
}
)
# Merge the .confdb files
_merge_files_confdb
(
${
plugin_name
}
"
${
CMAKE_CURRENT_BINARY_DIR
}
/genConfDir/
${
package_name
}
/
${
plugin_name
}
.confdb"
)
# see private functions at the end
_merge_files
(
${
PROJECT_NAME
}
_MergeConfDB2
"
${
CMAKE_BINARY_DIR
}
/
${
PROJECT_NAME
}
.confdb2"
# see private functions at the end
${
plugin_name
}
"
${
CMAKE_CURRENT_BINARY_DIR
}
/genConfDir/
${
package_name
}
/
${
plugin_name
}
.confdb2_part"
"Merging .confdb2 files for
${
PROJECT_NAME
}
"
)
set_property
(
TARGET
${
PROJECT_NAME
}
_MergeConfDB2 PROPERTY command run merge_confdb2_parts
)
set_property
(
TARGET
${
PROJECT_NAME
}
_MergeConfDB2 PROPERTY output_option --output
)
_merge_files_confdb2
(
${
plugin_name
}
"
${
CMAKE_CURRENT_BINARY_DIR
}
/genConfDir/
${
package_name
}
/
${
plugin_name
}
.confdb2_part"
)
# To append the path to the generated library to LD_LIBRARY_PATH with run
_gaudi_runtime_prepend
(
ld_library_path $<TARGET_FILE_DIR:
${
plugin_name
}
>
)
# To append the path to the generated Conf.py file to PYTHONPATH
...
...
@@ -1215,7 +1211,29 @@ function(_merge_files_confdb dependency file_to_merge)
${
dependency
}
"
${
file_to_merge
}
"
"Merging .confdb files for
${
PROJECT_NAME
}
"
)
endfunction
()
# special merge function for .confdb2 as a workaround for https://gitlab.cern.ch/gaudi/Gaudi/-/issues/258
function
(
_merge_files_confdb2 dependency file_to_merge
)
set
(
merge_target
${
PROJECT_NAME
}
_MergeConfDB2
)
if
(
NOT TARGET
${
merge_target
}
)
if
(
APPLE
)
set
(
output_files
${
CMAKE_BINARY_DIR
}
/
${
PROJECT_NAME
}
.confdb2
${
CMAKE_BINARY_DIR
}
/
${
PROJECT_NAME
}
.confdb2.db
)
else
()
set
(
output_files
${
CMAKE_BINARY_DIR
}
/
${
PROJECT_NAME
}
.confdb2
)
endif
()
add_custom_command
(
OUTPUT
${
output_files
}
COMMAND run merge_confdb2_parts $<TARGET_PROPERTY:
${
merge_target
}
,fragments>
--output
${
CMAKE_BINARY_DIR
}
/
${
PROJECT_NAME
}
.confdb2
DEPENDS $<TARGET_PROPERTY:
${
merge_target
}
,fragments>
COMMENT
"Merging .confdb2 files for
${
PROJECT_NAME
}
"
COMMAND_EXPAND_LISTS
)
add_custom_target
(
${
merge_target
}
ALL DEPENDS
${
output_files
}
)
install
(
FILES
${
output_files
}
TYPE LIB
${
_gaudi_install_optional
}
)
endif
()
add_dependencies
(
${
merge_target
}
${
dependency
}
)
set_property
(
TARGET
${
merge_target
}
APPEND PROPERTY fragments
"
${
file_to_merge
}
"
)
endfunction
()
# A function to factor out nosetests and pytest lookup
function
(
_import_runtime runtime
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment