Skip to content

Commit

Permalink
[nV] 对CMake/Utils.cmake的一处改进,在add_common_to_target宏的定义中,仅当PCHSupport.…
Browse files Browse the repository at this point in the history
…cmake报告PCHSupport_FOUND时使用预编译头文件。
  • Loading branch information
baritono committed Nov 10, 2012
1 parent 166355b commit 687f6e7
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions CMake/Utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ endif (NOT CMAKE_BUILD_TYPE)
include(PCHSupport)

macro (add_common_to_target target)
add_native_precompiled_header(
${target}
${CMAKE_CURRENT_SOURCE_DIR}/common.h
${CMAKE_CURRENT_SOURCE_DIR}/common.cpp
)
if (PCHSupport_FOUND)
add_native_precompiled_header(
${target}
${CMAKE_CURRENT_SOURCE_DIR}/common.h
${CMAKE_CURRENT_SOURCE_DIR}/common.cpp
)
endif (PCHSupport_FOUND)
endmacro ()

macro (new_shared_library project)
Expand Down Expand Up @@ -86,4 +88,5 @@ endmacro ()
macro (new_nv_script script package)
configure_file(${script} ${NVSCRIPT_OUTPUT_PATH}/${package}/${script} COPYONLY)
install(FILES ${script} DESTINATION ${NVSCRIPT_RELATIVE_DIR}/${package}/)
endmacro ()
endmacro ()

0 comments on commit 687f6e7

Please sign in to comment.