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:
Diffstat (limited to 'build_files/cmake/project_source_info.py')
-rw-r--r--build_files/cmake/project_source_info.py26
1 files changed, 21 insertions, 5 deletions
diff --git a/build_files/cmake/project_source_info.py b/build_files/cmake/project_source_info.py
index ed17ec5bac4..10bc36ba1a8 100644
--- a/build_files/cmake/project_source_info.py
+++ b/build_files/cmake/project_source_info.py
@@ -48,7 +48,7 @@ def is_c_header(filename):
def is_c(filename):
ext = os.path.splitext(filename)[1]
- return (ext in (".c", ".cpp", ".cxx", ".m", ".mm", ".rc", ".cc", ".inl"))
+ return (ext in {".c", ".cpp", ".cxx", ".m", ".mm", ".rc", ".cc", ".inl", ".osl"})
def is_c_any(filename):
@@ -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):