Skip to content

Commit bfacd9c

Browse files
authored
Merge pull request #91 from ax3l/cmake-extraConfig
CMake: Extra Configs & Superbuilds
2 parents 6432c1a + 65a90d9 commit bfacd9c

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

regtest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ def test_suite(argv):
480480
#--------------------------------------------------------------------------
481481
# Setup Cmake if needed
482482
#--------------------------------------------------------------------------
483-
if suite.useCmake:
483+
if suite.useCmake and not suite.isSuperbuild:
484484
cmake_setup(suite)
485485

486486

suite.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def __init__(self, name):
9999
self.diffDir = ""
100100
self.diffOpts = ""
101101

102+
self.cmakeSetupOpts = ""
102103
self.addToCompileString = ""
103104
self.ignoreGlobalMakeAdditions = 0
104105

@@ -381,6 +382,7 @@ def __init__(self, args):
381382
self.launch_dir = os.getcwd()
382383

383384
self.useCmake = 0
385+
self.isSuperbuild = 0
384386
self.use_ctools = 1
385387

386388
self.reportCoverage = args.with_coverage
@@ -1171,7 +1173,7 @@ def cmake_build( self, name, target, path, opts = '', env = None, outfile = None
11711173
else:
11721174
coutfile = f'{self.full_test_dir}{name}.{target}.make.log'
11731175

1174-
cmd = f'{self.MAKE} -j{self.numMakeJobs} {opts} {target}'
1176+
cmd = f'cmake --build {self.source_build_dir} -j {self.numMakeJobs} -- {opts} {target}'
11751177
self.log.log(cmd)
11761178
stdout, stderr, rc = test_util.run(cmd, outfile=coutfile, cwd=path, env=ENV )
11771179

@@ -1192,6 +1194,19 @@ def build_test_cmake(self, test, opts="", outfile=None):
11921194

11931195
env = {"AMReX_ROOT":self.amrex_install_dir}
11941196

1197+
# super-builds always need a configure now, all other builds might
1198+
# add additional CMake config options and re-configure on existing configured
1199+
# build directory, if additional build cmakeSetupOpts are set
1200+
if self.isSuperbuild or test.cmakeSetupOpts != "":
1201+
builddir, installdir = self.cmake_config(
1202+
name=test.name,
1203+
path=self.source_dir,
1204+
configOpts=self.amrex_cmake_opts + " " +
1205+
self.source_cmake_opts + " " +
1206+
test.cmakeSetupOpts)
1207+
self.source_build_dir = builddir
1208+
1209+
# compile
11951210
rc, comp_string = self.cmake_build( name = test.name,
11961211
target = test.target,
11971212
path = self.source_build_dir,

test_util.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
useCmake = < 0: GNU Make handles the build (default)
2323
1: CMake handles the build >
2424
25+
isSuperbuild = < 0: pre-build AMReX and source (default)
26+
1: CMake downloads AMReX and needs separate configure & build >
27+
2528
sourceTree = < C_Src or AMReX >
2629
2730
suiteName = < descriptive name (i.e. Castro) >

0 commit comments

Comments
 (0)