10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-26 23:22:18 +02:00

Merge pull request #97 from TApplencourt/master

Add bulddir variable in ninja
This commit is contained in:
Thomas Applencourt 2015-07-16 17:54:17 +02:00
commit e712cb410e
2 changed files with 16 additions and 8 deletions

View File

@ -86,7 +86,9 @@ def ninja_create_env_variable(pwd_config_file):
FC, FCFLAGS, IRPF90, IRPF90_FLAGS
The env variable is usefull for the generation of EZFIO, and IRPF90
"""
l_string = []
l_string = ["builddir = {0}".format(os.path.dirname(ROOT_BUILD_NINJA)),
""]
for flag in ["FC", "FCFLAGS", "IRPF90", "IRPF90_FLAGS"]:
str_ = "{0} = {1}".format(flag, get_compilation_option(pwd_config_file,
flag))
@ -722,11 +724,13 @@ def ninja_dot_tree_build(path_module, l_module):
# | | (_) (_| |_| | (/_
#
def create_build_ninja_module(path_module):
l_string = ["rule update_build_ninja_root",
" command = {0} update".format(__file__),
l_string = ["builddir = {0}".format(os.path.dirname(ROOT_BUILD_NINJA)),
""]
l_string += ["rule update_build_ninja_root",
" command = {0} update".format(__file__),
""]
l_string += ["rule make_local_binaries",
" command = ninja -f {0} module_{1}".format(
ROOT_BUILD_NINJA, path_module.rel), " pool = console",
@ -755,6 +759,8 @@ def create_build_ninja_module(path_module):
def create_build_ninja_global():
l_string = ["builddir = {0}".format(os.path.dirname(ROOT_BUILD_NINJA)),
""]
l_string = ["rule update_build_ninja_root",
" command = {0} update".format(__file__),
@ -942,6 +948,6 @@ if __name__ == "__main__":
# S a v e s #
# ~#~#~#~#~ #
with open(join(QP_ROOT, "config", "build.ninja"), "w+") as f:
with open(ROOT_BUILD_NINJA, "w+") as f:
f.write(header)
f.write("\n".join(l_string))

View File

@ -23,7 +23,7 @@ try:
from module_handler import ModuleHandler, get_dict_child
from module_handler import get_l_module_descendant
from update_README import Doc_key, Needed_key
from qp_path import QP_SRC, QP_PLUGINS
from qp_path import QP_SRC, QP_PLUGINS, QP_ROOT
except ImportError:
print "Please check if you have sourced the .quantum_package.rc"
print "(`source .quantum_package.rc`)"
@ -163,9 +163,11 @@ if __name__ == '__main__':
subprocess.check_call(["qp_create_ninja.py", "update"])
except:
raise
print "Done"
print "[ OK ]"
print "You can now compile as usual"
print "`cd {0} ; ninja` for exemple".format(QP_ROOT)
print " or --in developement mode-- you can cd in a directory and compile here"
elif arguments["uninstall"]: