Example #1
0
def _cmake_cmd_line_args(conanfile, generator, parallel):
    args = []
    if not generator:
        return args

    # Arguments related to parallel
    if parallel:
        if "Makefiles" in generator and "NMake" not in generator:
            njobs = make_jobs_cmd_line_arg(conanfile)
            if njobs:
                args.append(njobs)

        if "Ninja" in generator and "NMake" not in generator:
            njobs = ninja_jobs_cmd_line_arg(conanfile)
            if njobs:
                args.append(njobs)

        if "Visual Studio" in generator:
            max_cpu_count = msbuild_max_cpu_count_cmd_line_arg(conanfile)
            if max_cpu_count:
                args.append(max_cpu_count)

    # Arguments for verbosity
    if "Visual Studio" in generator:
        verbosity = msbuild_verbosity_cmd_line_arg(conanfile)
        if verbosity:
            args.append(verbosity)

    return args
Example #2
0
def test_none():
    c = ConfDefinition()
    c.loads(textwrap.dedent("""\
    """))

    conanfile = ConanFileMock()
    conanfile.conf = c.get_conanfile_conf(None)
    max_cpu_count = msbuild_max_cpu_count_cmd_line_arg(conanfile)
    assert max_cpu_count is None
Example #3
0
def test_tools_build():
    c = ConfDefinition()
    c.loads(textwrap.dedent("""\
        tools.build:processes=10
    """))

    conanfile = ConanFileMock()
    conanfile.conf = c.get_conanfile_conf(None)
    max_cpu_count = msbuild_max_cpu_count_cmd_line_arg(conanfile)
    assert max_cpu_count == "/m:10"
Example #4
0
def test_tools_ning():
    c = ConfDefinition()
    c.loads(textwrap.dedent("""\
        tools.microsoft.msbuild:max_cpu_count=23
    """))

    conanfile = ConanFileMock()
    conanfile.conf = c.get_conanfile_conf(None)
    max_cpu_count = msbuild_max_cpu_count_cmd_line_arg(conanfile)
    assert max_cpu_count == "/m:23"