diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33fc1e55e10..d07ced23089 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -373,6 +373,7 @@ jobs: run: | pixi run setup builddir pixi run build builddir + pixi run test builddir - name: Show build log if: failure() diff --git a/.vscode/build_vscode.py b/.vscode/build_vscode.py index 208d0fdc538..9cda20e69d6 100644 --- a/.vscode/build_vscode.py +++ b/.vscode/build_vscode.py @@ -19,15 +19,15 @@ if os.environ["BUILD_PARALLEL_MF6"] == '1': arg_parallel = "-Dparallel=true" -if args.action == "rebuild" and os.path.isdir(builddir): - shutil.rmtree(builddir) - if args.buildtype == "release": - setup_flag = ["-Doptimization=2"] + setup_flag = ["-Ddebug=false", "-Doptimization=2"] elif args.buildtype == "debug": setup_flag = ["-Ddebug=true", "-Doptimization=0"] + +if args.action == "rebuild": + setup_flag += ["--wipe"] -if not os.path.isdir(builddir): +if args.action == "rebuild": command = [ "meson", "setup", @@ -44,14 +44,16 @@ check=True, ) -# Remove all files from bin folder -bin_dir = os.path.join(os.getcwd(), "bin") -if os.path.isdir(bin_dir): - for dir_entry in os.scandir(bin_dir): - path = dir_entry.path - if os.path.isfile(path): - os.remove(path) - -command = ["meson", "install", "-C", builddir] -print("Run:", shlex.join(command)) -subprocess.run(command, check=True) +if args.action == "rebuild" or args.action == "build": + # Remove all files from bin folder + bin_dir = os.path.join(os.getcwd(), "bin") + if os.path.isdir(bin_dir): + for dir_entry in os.scandir(bin_dir): + path = dir_entry.path + if os.path.isfile(path): + os.remove(path) + + command = ["meson", "install", "-C", builddir] + print("Run:", shlex.join(command)) + subprocess.run(command, check=True) + diff --git a/meson.build b/meson.build index 0da78223a9e..e8fdd60cdca 100644 --- a/meson.build +++ b/meson.build @@ -102,7 +102,15 @@ elif fc_id == 'intel-llvm-cl' link_args += ['/ignore:4217', # access through ddlimport might be inefficient '/ignore:4286' # same as 4217, but more general ] +endif +# add the correct C/C++ CRT runtime on Windows based on profile +if build_machine.system() == 'windows' + if get_option('debug') == 'true' + compile_args += ['/MTd'] + else + compile_args += ['/MT'] + endif endif # parallel build options @@ -240,6 +248,7 @@ if with_mpi if mpiexec.found() test('Parallel version command line test', mpiexec, args : ['-n', '2', mf6exe, '-v', '-p'], is_parallel : false) test('Parallel compiler command line test', mpiexec, args : ['-n', '2', mf6exe, '-c', '-p'], is_parallel : false) + test('Parallel compiler options command line test', mpiexec, args : ['-n', '2', mf6exe, '-co', '-p'], is_parallel : false) test('Serial simulation test', mf6exe, workdir : testdir, is_parallel : false) test('Parallel simulation test - 1 core', mpiexec, workdir : testdir, args : ['-n', '1', mf6exe, '-p'], is_parallel : false) test('Parallel simulation test - 2 cores', mpiexec, workdir : testdir, args : ['-n', '2', mf6exe, '-p'], is_parallel : false) @@ -247,6 +256,7 @@ if with_mpi else test('Version command line test', mf6exe, args : ['-v',]) test('Compiler command line test', mf6exe, args : ['-c',]) + test('Compiler options command line test', mf6exe, args : ['-co',]) test('Test installation help', mf6exe, args : ['-h',]) test('Serial simulation test', mf6exe, workdir : testdir) endif