Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-10-15 18:11:30 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-10-15 18:11:30 +0400
commitc2ba1324fb2ee5e18bb0a2bf77b125b0d5caeaf3 (patch)
tree206e9035bf45583dae0e0f856c23eab010bba2cf /build_files
parent3c56c1f68d20365d3afc1065ded3e4889cdcd53f (diff)
add support for using ninja to extract build info for qtcreator/netbeans/error-checkers.
Diffstat (limited to 'build_files')
-rw-r--r--build_files/cmake/project_source_info.py24
1 files changed, 20 insertions, 4 deletions
diff --git a/build_files/cmake/project_source_info.py b/build_files/cmake/project_source_info.py
index 17a9327a358..d80145b989c 100644
--- a/build_files/cmake/project_source_info.py
+++ b/build_files/cmake/project_source_info.py
@@ -82,10 +82,20 @@ def makefile_log():
import subprocess
import time
- print("running make with --dry-run ...")
- process = subprocess.Popen(["make", "--always-make", "--dry-run", "--keep-going", "VERBOSE=1"],
- stdout=subprocess.PIPE,
- )
+ # support both make and ninja
+ make_exe = cmake_cache_var("CMAKE_MAKE_PROGRAM")
+ make_exe_basename = os.path.basename(make_exe)
+
+ if make_exe_basename.startswith("make"):
+ print("running 'make' with --dry-run ...")
+ process = subprocess.Popen([make_exe, "--always-make", "--dry-run", "--keep-going", "VERBOSE=1"],
+ stdout=subprocess.PIPE,
+ )
+ elif make_exe_basename.startswith("ninja"):
+ print("running 'ninja' with -t commands ...")
+ process = subprocess.Popen([make_exe, "-t", "commands"],
+ stdout=subprocess.PIPE,
+ )
while process.poll():
time.sleep(1)
@@ -145,6 +155,12 @@ def build_info(use_c=True, use_cxx=True, ignore_prefix_list=None):
source.append((c, inc_dirs, defs))
+ # make relative includes absolute
+ # not totally essential but useful
+ for i, f in enumerate(inc_dirs):
+ if not os.path.isabs(f):
+ inc_dirs[i] = os.path.abspath(os.path.join(CMAKE_DIR, f))
+
# safety check that our includes are ok
for f in inc_dirs:
if not os.path.exists(f):