Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
51c0c7aa
Commit
51c0c7aa
authored
Jan 11, 2010
by
Tarek Ziadé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed #5372: .o files are now always rebuilt because file age test don't work in some case
parent
9692427a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
94 deletions
+2
-94
ccompiler.py
ccompiler.py
+2
-94
No files found.
ccompiler.py
View file @
51c0c7aa
...
...
@@ -337,10 +337,7 @@ class CCompiler:
def
_setup_compile
(
self
,
outdir
,
macros
,
incdirs
,
sources
,
depends
,
extra
):
"""Process arguments and decide which source files to compile.
Merges _fix_compile_args() and _prep_compile().
"""
"""Process arguments and decide which source files to compile."""
if
outdir
is
None
:
outdir
=
self
.
output_dir
elif
not
isinstance
(
outdir
,
str
):
...
...
@@ -370,41 +367,6 @@ class CCompiler:
output_dir
=
outdir
)
assert
len
(
objects
)
==
len
(
sources
)
# XXX should redo this code to eliminate skip_source entirely.
# XXX instead create build and issue skip messages inline
if
self
.
force
:
skip_source
=
{}
# rebuild everything
for
source
in
sources
:
skip_source
[
source
]
=
0
elif
depends
is
None
:
# If depends is None, figure out which source files we
# have to recompile according to a simplistic check. We
# just compare the source and object file, no deep
# dependency checking involving header files.
skip_source
=
{}
# rebuild everything
for
source
in
sources
:
# no wait, rebuild nothing
skip_source
[
source
]
=
1
n_sources
,
n_objects
=
newer_pairwise
(
sources
,
objects
)
for
source
in
n_sources
:
# no really, only rebuild what's
skip_source
[
source
]
=
0
# out-of-date
else
:
# If depends is a list of files, then do a different
# simplistic check. Assume that each object depends on
# its source and all files in the depends list.
skip_source
=
{}
# L contains all the depends plus a spot at the end for a
# particular source file
L
=
depends
[:]
+
[
None
]
for
i
in
range
(
len
(
objects
)):
source
=
sources
[
i
]
L
[
-
1
]
=
source
if
newer_group
(
L
,
objects
[
i
]):
skip_source
[
source
]
=
0
else
:
skip_source
[
source
]
=
1
pp_opts
=
gen_preprocess_options
(
macros
,
incdirs
)
build
=
{}
...
...
@@ -413,10 +375,7 @@ class CCompiler:
obj
=
objects
[
i
]
ext
=
os
.
path
.
splitext
(
src
)[
1
]
self
.
mkpath
(
os
.
path
.
dirname
(
obj
))
if
skip_source
[
src
]:
log
.
debug
(
"skipping %s (%s up-to-date)"
,
src
,
obj
)
else
:
build
[
obj
]
=
src
,
ext
build
[
obj
]
=
(
src
,
ext
)
return
macros
,
objects
,
extra
,
pp_opts
,
build
...
...
@@ -463,56 +422,6 @@ class CCompiler:
# _fix_compile_args ()
def
_prep_compile
(
self
,
sources
,
output_dir
,
depends
=
None
):
"""Decide which souce files must be recompiled.
Determine the list of object files corresponding to 'sources',
and figure out which ones really need to be recompiled.
Return a list of all object files and a dictionary telling
which source files can be skipped.
"""
# Get the list of expected output (object) files
objects
=
self
.
object_filenames
(
sources
,
output_dir
=
output_dir
)
assert
len
(
objects
)
==
len
(
sources
)
if
self
.
force
:
skip_source
=
{}
# rebuild everything
for
source
in
sources
:
skip_source
[
source
]
=
0
elif
depends
is
None
:
# If depends is None, figure out which source files we
# have to recompile according to a simplistic check. We
# just compare the source and object file, no deep
# dependency checking involving header files.
skip_source
=
{}
# rebuild everything
for
source
in
sources
:
# no wait, rebuild nothing
skip_source
[
source
]
=
1
n_sources
,
n_objects
=
newer_pairwise
(
sources
,
objects
)
for
source
in
n_sources
:
# no really, only rebuild what's
skip_source
[
source
]
=
0
# out-of-date
else
:
# If depends is a list of files, then do a different
# simplistic check. Assume that each object depends on
# its source and all files in the depends list.
skip_source
=
{}
# L contains all the depends plus a spot at the end for a
# particular source file
L
=
depends
[:]
+
[
None
]
for
i
in
range
(
len
(
objects
)):
source
=
sources
[
i
]
L
[
-
1
]
=
source
if
newer_group
(
L
,
objects
[
i
]):
skip_source
[
source
]
=
0
else
:
skip_source
[
source
]
=
1
return
objects
,
skip_source
# _prep_compile ()
def
_fix_object_args
(
self
,
objects
,
output_dir
):
"""Typecheck and fix up some arguments supplied to various methods.
Specifically: ensure that 'objects' is a list; if output_dir is
...
...
@@ -679,7 +588,6 @@ class CCompiler:
Raises CompileError on failure.
"""
# A concrete compiler class can either override this method
# entirely or implement _compile().
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment