mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00
Merge topic 'cmake-build-specify-makefile-name'
cfce067b3f
Tests: Add RunCMake.Make case for conflicting Makefile names378c047ae3
Makefiles: Explicitly tell 'make' tool what Makefile name to use Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5509
This commit is contained in:
@@ -589,6 +589,11 @@ cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
|
||||
}
|
||||
makeCommand.Add(this->SelectMakeProgram(makeProgram));
|
||||
|
||||
// Explicitly tell the make tool to use the Makefile written by
|
||||
// cmLocalUnixMakefileGenerator3::WriteLocalMakefile
|
||||
makeCommand.Add("-f");
|
||||
makeCommand.Add("Makefile");
|
||||
|
||||
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
|
||||
if (jobs == cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
|
||||
makeCommand.Add("-j");
|
||||
|
5
Tests/RunCMake/Make/MakefileConflict.cmake
Normal file
5
Tests/RunCMake/Make/MakefileConflict.cmake
Normal file
@@ -0,0 +1,5 @@
|
||||
add_custom_target(Custom)
|
||||
|
||||
# Write a file that GNU make will prefer over "Makefile"
|
||||
# if 'cmake --build' does not explicitly specify it.
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/GNUmakefile" "")
|
@@ -42,6 +42,14 @@ run_VerboseBuild()
|
||||
run_cmake(CustomCommandDepfile-ERROR)
|
||||
run_cmake(IncludeRegexSubdir)
|
||||
|
||||
function(run_MakefileConflict)
|
||||
run_cmake(MakefileConflict)
|
||||
set(RunCMake_TEST_NO_CLEAN 1)
|
||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/MakefileConflict-build)
|
||||
run_cmake_command(MakefileConflict-build ${CMAKE_COMMAND} --build . --target Custom)
|
||||
endfunction()
|
||||
run_MakefileConflict()
|
||||
|
||||
function(run_CMP0113 val)
|
||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMP0113-${val}-build)
|
||||
run_cmake(CMP0113-${val})
|
||||
|
Reference in New Issue
Block a user