-
Notifications
You must be signed in to change notification settings - Fork 948
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CMAKE_MAKE_PROGRAM for mingw (#10770)
* Set CMAKE_MAKE_PROGRAM when mingw * simplify code * Replace path * In command line * Test configure * Fix import * another bad import
- Loading branch information
Showing
2 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
conans/test/unittests/tools/cmake/test_cmake_configure_args.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import pytest | ||
from mock import mock | ||
from mock.mock import Mock | ||
|
||
from conan.tools.cmake import CMake | ||
from conan.tools.files.files import save_toolchain_args | ||
from conans import ConanFile, Settings | ||
from conans.model.conf import Conf | ||
from conans.model.env_info import EnvValues | ||
from conans.test.utils.test_files import temp_folder | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def conanfile(): | ||
c = ConanFile(Mock(), None) | ||
c.settings = "os", "compiler", "build_type", "arch" | ||
c.initialize(Settings({"os": ["Windows"], | ||
"compiler": {"gcc": {"libcxx": ["libstdc++"]}}, | ||
"build_type": ["Release"], | ||
"arch": ["x86"]}), EnvValues()) | ||
c.settings.build_type = "Release" | ||
c.settings.arch = "x86" | ||
c.settings.compiler = "gcc" | ||
c.settings.compiler.libcxx = "libstdc++" | ||
c.settings.os = "Windows" | ||
c.conf = Conf() | ||
tmp_folder = temp_folder() | ||
c.folders.set_base_generators(tmp_folder) | ||
c.folders.generators = "." | ||
c.folders.set_base_build(tmp_folder) | ||
return c | ||
|
||
|
||
def test_cmake_make_program(conanfile): | ||
save_toolchain_args({"cmake_generator": "MinGW Makefiles"}, | ||
generators_folder=conanfile.folders.generators_folder) | ||
|
||
def run(command): | ||
assert '-DCMAKE_MAKE_PROGRAM="C:/mymake.exe"' in command | ||
|
||
conanfile.run = run | ||
conanfile.conf.define("tools.gnu:make_program", "C:\\mymake.exe") | ||
with mock.patch("platform.system", mock.MagicMock(return_value='Windows')): | ||
cmake = CMake(conanfile) | ||
cmake.configure() |