mirror of
https://github.com/reactos/reactos.git
synced 2025-04-26 08:30:21 +00:00
[CMAKE]
* Implement the _clean targets for the ninja generator. svn path=/trunk/; revision=56299
This commit is contained in:
parent
a2a6c99792
commit
ccc0959e61
1 changed files with 13 additions and 9 deletions
|
@ -222,16 +222,20 @@ function(add_cd_file)
|
|||
endfunction()
|
||||
|
||||
# Create module_clean targets
|
||||
function(add_clean_target target)
|
||||
if(CMAKE_GENERATOR MATCHES "Unix Makefiles" OR CMAKE_GENERATOR MATCHES "MinGW Makefiles")
|
||||
set(CLEAN_COMMAND make clean)
|
||||
elseif(CMAKE_GENERATOR MATCHES "NMake Makefiles")
|
||||
set(CLEAN_COMMAND nmake /nologo clean)
|
||||
function(add_clean_target _target)
|
||||
set(_clean_working_directory ${CMAKE_CURRENT_BINARY_DIR})
|
||||
if(CMAKE_GENERATOR STREQUAL "Unix Makefiles" OR CMAKE_GENERATOR STREQUAL "MinGW Makefiles")
|
||||
set(_clean_command make clean)
|
||||
elseif(CMAKE_GENERATOR STREQUAL "NMake Makefiles")
|
||||
set(_clean_command nmake /nologo clean)
|
||||
elseif(CMAKE_GENERATOR STREQUAL "Ninja")
|
||||
set(_clean_command ninja -t clean ${_target})
|
||||
set(_clean_working_directory ${REACTOS_BINARY_DIR})
|
||||
endif()
|
||||
add_custom_target(${target}_clean
|
||||
COMMAND ${CLEAN_COMMAND}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Cleaning ${target}")
|
||||
add_custom_target(${_target}_clean
|
||||
COMMAND ${_clean_command}
|
||||
WORKING_DIRECTORY ${_clean_working_directory}
|
||||
COMMENT "Cleaning ${_target}")
|
||||
endfunction()
|
||||
|
||||
if(NOT MSVC_IDE)
|
||||
|
|
Loading…
Reference in a new issue