Skip to content

Commit

Permalink
Add options Build.py (#158)
Browse files Browse the repository at this point in the history
* Add options to Build.py

* Force CMake to refresh cache. Previously if you tried to recompile with different options nothing would happen. Needs cmake v3.24

* Version bump

* Options syntax can be "-o [option1] -o [option2]" or "-o [option1] [option2]"

* Removed debugging line.
  • Loading branch information
vollous committed Nov 5, 2024
1 parent 44c3b7c commit 02a3799
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
9 changes: 7 additions & 2 deletions Build.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,21 @@ def get_preset():
return preset

def build(preset):
cmd=f"cmake --preset {preset}".split()
cmd=f"cmake --preset {preset} --fresh".split()
subprocess.check_call(cmd)

cmd=f"cmake --build --preset {preset}".split()
subprocess.check_call(cmd)


def main():
opts = Setup.parse_arguments()
Setup.setup_profiles()
Setup.conan_install_all(Setup.BuildMode.release,build_missing=True)
Setup.conan_install_all(Setup.BuildMode.release,
opts.options if opts.options is not None else [],
build_missing=True,
custom_profile=opts.profile
)
build(get_preset())

if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
cmake_minimum_required(VERSION 3.23)
project(
BSMPT
VERSION 3.0.5
VERSION 3.0.6
LANGUAGES C CXX
DESCRIPTION
"BSMPT - Beyond the Standard Model Phase Transitions : A C++ package for the computation of the EWPT in BSM models"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SPDX-FileCopyrightText: 2021 Philipp Basler, Margarete Mühlleitner and Jonas M
SPDX-License-Identifier: GPL-3.0-or-later
-->

Program: BSMPT version 3.0.5
Program: BSMPT version 3.0.6

Released by: Philipp Basler, Lisa Biermann, Margarete Mühlleitner, Jonas Müller, Rui Santos and João Viana

Expand Down
11 changes: 8 additions & 3 deletions Setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ def __str__(self):
return self.name


if __name__ == "__main__":

def parse_arguments():
parser = ArgumentParser()
parser.add_argument(
"--mode",
Expand All @@ -202,6 +201,7 @@ def __str__(self):
"--options",
"-o",
nargs="+",
action="extend",
help="Options to pass through to conan. For the available options please look into the conanfile.",
)
parser.add_argument(
Expand All @@ -216,7 +216,12 @@ def __str__(self):
default="",
)

opts = parser.parse_args()
return parser.parse_args()


if __name__ == "__main__":

opts = parse_arguments()
setup_profiles()
conan_install_all(
opts.mode,
Expand Down

0 comments on commit 02a3799

Please sign in to comment.