Cleaned up/updated CLion project generation code and templates.
This commit is contained in:
14
SConscript
14
SConscript
@@ -3,11 +3,16 @@ import copy
|
||||
import enum
|
||||
import glob
|
||||
import inspect
|
||||
import jinja2
|
||||
import json
|
||||
import multiprocessing
|
||||
import os
|
||||
import pathlib
|
||||
import psutil
|
||||
import shutil
|
||||
import sys
|
||||
import time
|
||||
import uuid
|
||||
|
||||
|
||||
class TargetType(enum.Enum):
|
||||
@@ -478,15 +483,9 @@ def _generate_project(project_type: str) -> None:
|
||||
}.get(project_type, (None, None))
|
||||
if not source_folder:
|
||||
_error(None, 'Invalid project type option.')
|
||||
|
||||
import uuid
|
||||
def _generate_uuid() -> str:
|
||||
return str(uuid.uuid4())
|
||||
|
||||
import pathlib
|
||||
import shutil
|
||||
import multiprocessing
|
||||
|
||||
root_path = pathlib.Path(env.Dir('#').abspath)
|
||||
def _get_executables() -> list:
|
||||
result = []
|
||||
@@ -500,7 +499,6 @@ def _generate_project(project_type: str) -> None:
|
||||
})
|
||||
return result
|
||||
|
||||
import jinja2
|
||||
jinja_env = jinja2.Environment()
|
||||
jinja_env.globals['generate_uuid'] = _generate_uuid
|
||||
jinja_env.globals['project'] = {
|
||||
@@ -508,7 +506,7 @@ def _generate_project(project_type: str) -> None:
|
||||
'executables': _get_executables(),
|
||||
'build_types': ['debug', 'release_debug', 'release', 'profile']
|
||||
}
|
||||
jinja_env.globals['scons_exe'] = env['ENV']['_']
|
||||
jinja_env.globals['scons_exe'] = shutil.which('scons')
|
||||
jinja_env.globals['nproc'] = multiprocessing.cpu_count()
|
||||
|
||||
source_path = pathlib.Path(source_folder)
|
||||
|
||||
Reference in New Issue
Block a user