mirror of
https://github.com/reactos/reactos.git
synced 2025-04-26 16:40:27 +00:00
[CMAKE]
- add a small functions for preprocessing files with C compiler. unused/untested svn path=/trunk/; revision=56149
This commit is contained in:
parent
9fbfe075cb
commit
94ef1bd227
1 changed files with 16 additions and 0 deletions
|
@ -377,3 +377,19 @@ function(set_module_type MODULE TYPE)
|
|||
# do compiler specific stuff
|
||||
set_module_type_toolchain(${MODULE} ${TYPE})
|
||||
endfunction()
|
||||
|
||||
function(preprocess_file __in __out)
|
||||
set(__arg ${__in})
|
||||
foreach(__def in ${ARGN})
|
||||
list(APPEND __arg -D${__def})
|
||||
endforeach()
|
||||
if(MSVC)
|
||||
add_custom_command(OUTPUT ${_out}
|
||||
COMMAND ${CMAKE_C_COMPILER} /EP ${__arg}
|
||||
DEPENDS ${__in})
|
||||
else()
|
||||
add_custom_command(OUTPUT ${_out}
|
||||
COMMAND ${CMAKE_C_COMPILER} -E ${__arg}
|
||||
DEPENDS ${__in})
|
||||
endif()
|
||||
endfunction()
|
||||
|
|
Loading…
Reference in a new issue