mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
C++: DEPFILE is supported on most generator in recent cmake versions
This commit is contained in:
parent
de0836d1a0
commit
e46704465b
2 changed files with 14 additions and 28 deletions
|
@ -20,34 +20,19 @@ function(SLINT_TARGET_SOURCES target)
|
|||
set(global_fallback "${DEFAULT_SLINT_EMBED_RESOURCES}")
|
||||
set(embed "$<IF:$<STREQUAL:${t_prop},>,${global_fallback},${t_prop}>")
|
||||
|
||||
if(CMAKE_GENERATOR STREQUAL "Ninja")
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_SLINT_BASE_NAME}.h
|
||||
COMMAND Slint::slint-compiler ${_SLINT_ABSOLUTE}
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/${_SLINT_BASE_NAME}.h
|
||||
--depfile ${CMAKE_CURRENT_BINARY_DIR}/${_SLINT_BASE_NAME}.d
|
||||
--style ${_SLINT_STYLE}
|
||||
--embed-resources=${embed}
|
||||
--translation-domain="${target}"
|
||||
DEPENDS Slint::slint-compiler ${_SLINT_ABSOLUTE}
|
||||
COMMENT "Generating ${_SLINT_BASE_NAME}.h"
|
||||
DEPFILE ${CMAKE_CURRENT_BINARY_DIR}/${_SLINT_BASE_NAME}.d
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
else(CMAKE_GENERATOR STREQUAL "Ninja")
|
||||
get_filename_component(_SLINT_DIR ${_SLINT_ABSOLUTE} DIRECTORY )
|
||||
file(GLOB ALL_SLINTS "${_SLINT_DIR}/*.slint")
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_SLINT_BASE_NAME}.h
|
||||
COMMAND Slint::slint-compiler ${_SLINT_ABSOLUTE}
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/${_SLINT_BASE_NAME}.h
|
||||
--style ${_SLINT_STYLE}
|
||||
--embed-resources=${embed}
|
||||
--translation-domain="${target}"
|
||||
DEPENDS Slint::slint-compiler ${_SLINT_ABSOLUTE} ${ALL_SLINTS}
|
||||
COMMENT "Generating ${_SLINT_BASE_NAME}.h"
|
||||
)
|
||||
endif(CMAKE_GENERATOR STREQUAL "Ninja")
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_SLINT_BASE_NAME}.h
|
||||
COMMAND Slint::slint-compiler ${_SLINT_ABSOLUTE}
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/${_SLINT_BASE_NAME}.h
|
||||
--depfile ${CMAKE_CURRENT_BINARY_DIR}/${_SLINT_BASE_NAME}.d
|
||||
--style ${_SLINT_STYLE}
|
||||
--embed-resources=${embed}
|
||||
--translation-domain="${target}"
|
||||
DEPENDS Slint::slint-compiler ${_SLINT_ABSOLUTE}
|
||||
COMMENT "Generating ${_SLINT_BASE_NAME}.h"
|
||||
DEPFILE ${CMAKE_CURRENT_BINARY_DIR}/${_SLINT_BASE_NAME}.d
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
|
||||
target_sources(${target} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/${_SLINT_BASE_NAME}.h)
|
||||
endforeach()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue