Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Root
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
为了安全,强烈建议开启2FA双因子认证:User Settings -> Account -> Enable two-factor authentication!!!
Show more breadcrumbs
cxwx
Root
Commits
7484830b
Commit
7484830b
authored
10 years ago
by
Danilo Piparo
Browse files
Options
Downloads
Patches
Plain Diff
Translate also makepch.sh in python for Win32 builds
parent
fe831938
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+2
-2
2 additions, 2 deletions
CMakeLists.txt
etc/dictpch/makepch.py
+110
-0
110 additions, 0 deletions
etc/dictpch/makepch.py
with
112 additions
and
2 deletions
CMakeLists.txt
+
2
−
2
View file @
7484830b
...
...
@@ -137,8 +137,8 @@ add_custom_command(OUTPUT etc/dictpch/allLinkDefs.h
DEPENDS
${
CMAKE_SOURCE_DIR
}
/build/unix/makepchinput.py
${
__allFiles
}
)
add_custom_command
(
OUTPUT etc/allDict.cxx.pch
COMMAND
${
CMAKE_SOURCE_DIR
}
/etc/dictpch/makepch.
sh
etc/allDict.cxx.pch -I
${
CMAKE_BINARY_DIR
}
/
${
CMAKE_INSTALL_INCLUDEDIR
}
DEPENDS
${
CMAKE_SOURCE_DIR
}
/etc/dictpch/makepch.
sh
COMMAND
${
CMAKE_SOURCE_DIR
}
/etc/dictpch/makepch.
py
etc/allDict.cxx.pch -I
${
CMAKE_BINARY_DIR
}
/
${
CMAKE_INSTALL_INCLUDEDIR
}
DEPENDS
${
CMAKE_SOURCE_DIR
}
/etc/dictpch/makepch.
py
etc/dictpch/allLinkDefs.h
etc/dictpch/allHeaders.h
etc/dictpch/allCppflags.txt
...
...
This diff is collapsed.
Click to expand it.
etc/dictpch/makepch.py
0 → 100755
+
110
−
0
View file @
7484830b
#! /usr/bin/env python
#
# Build a pch for the headers and linkdefs in root-build-dir/etc/dictpch/.
# root-build-dir is first tried as ./ - if that doesn't exist, $ROOTSYS
# is taken as root-build-dir.
#
# $1: PCH output file name
# $2: cxxflags (optional; required if extra headers are supplied)
# $3: extra headers to be included in the PCH (optional)
#
# exit code 1 for invocation errors; else exit code of rootcling invocation.
#
# Copyright (c) 2014 Rene Brun and Fons Rademakers
# Author: Axel Naumann <axel@cern.ch>, 2014-10-16
# Translated to python by Danilo Piparo, 2015-4-23
import
sys
import
os
import
shutil
#-------------------------------------------------------------------------------
def
getArgs
():
argv
=
sys
.
argv
argc
=
len
(
argv
)
if
argc
<
2
:
print
"
ERROR: too few arguments specified!
"
pchFileName
=
argv
[
1
]
cxxflags
=
""
if
argc
>
2
:
cxxflags
=
argv
[
2
]
extraHeadersList
=
""
if
argc
>
3
:
extraHeadersList
=
argv
[
2
:]
return
pchFileName
,
cxxflags
,
extraHeadersList
#-------------------------------------------------------------------------------
def
getCppFlags
(
cppflagsFilename
):
ifile
=
open
(
cppflagsFilename
)
lines
=
ifile
.
readlines
()
ifile
.
close
()
cppFlags
=
"
"
.
join
(
map
(
lambda
line
:
line
[:
-
1
],
lines
))
return
cppFlags
#-------------------------------------------------------------------------------
def
makepch
():
"""
Create a pch starting from the following arguments
1) pch file name
2) Compiler flags - optional, required if extra headers are supplied
3) Extra headers - optional
"""
rootdir
=
"
.
"
cfgdir
=
os
.
path
.
join
(
"
etc
"
,
"
dictpch
"
)
allheadersFilename
=
os
.
path
.
join
(
cfgdir
,
"
allHeaders.h
"
)
alllinkdefsFilename
=
os
.
path
.
join
(
cfgdir
,
"
allLinkDefs.h
"
)
cppflagsFilename
=
os
.
path
.
join
(
cfgdir
,
"
allCppflags.txt
"
)
pchFileName
,
extraCppflags
,
extraHeadersList
=
getArgs
()
extraHeaders
=
"
"
.
join
(
extraHeadersList
)
rootbuildFlag
=
""
loc1
=
os
.
path
.
join
(
rootdir
,
allheadersFilename
)
rootsys
=
os
.
environ
[
"
ROOTSYS
"
]
loc2
=
os
.
path
.
join
(
rootsys
,
allheadersFilename
)
if
not
os
.
path
.
exists
(
loc1
):
rootdir
=
rootsys
if
not
os
.
path
.
exists
(
loc2
):
print
"
ERROR: cannot find %s file here %s nor here %s
"
%
(
allheadersFilename
,
loc1
,
loc2
)
sys
.
exit
(
1
)
else
:
rootbuildFlag
=
"
-rootbuild
"
cppFlags
=
getCppFlags
(
cppflagsFilename
)
cppflagsList
=
[
"
-D__CLING__
"
,
"
-D__STDC_LIMIT_MACROS
"
,
"
-D__STDC_CONSTANT_MACROS
"
,
"
-DROOT_PCH
"
,
"
-I%s
"
%
os
.
path
.
join
(
rootdir
,
"
include
"
),
"
-I%s
"
%
os
.
path
.
join
(
rootdir
,
"
etc
"
),
"
-I%s
"
%
os
.
path
.
join
(
rootdir
,
cfgdir
),
"
-I%s
"
%
os
.
path
.
join
(
rootdir
,
"
etc
"
,
"
cling
"
),
cppFlags
]
cppflagsList
.
append
(
extraCppflags
)
allCppFlags
=
"
"
.
join
(
cppflagsList
)
rootclingExe
=
os
.
path
.
join
(
rootdir
,
"
bin
"
,
"
rootcling
"
)
command
=
"
%s %s -1 -f allDict.cxx -noDictSelection -c %s %s %s %s
"
%
(
rootclingExe
,
rootbuildFlag
,
allCppFlags
,
allheadersFilename
,
extraHeaders
,
alllinkdefsFilename
)
ret
=
os
.
system
(
command
)
if
ret
==
0
:
shutil
.
move
(
"
allDict_rdict.pch
"
,
pchFileName
)
os
.
unlink
(
"
allDict.cxx
"
)
sys
.
exit
(
ret
)
if
__name__
==
"
__main__
"
:
ret
=
makepch
()
sys
.
exit
(
ret
)
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