已合并
Involve ccache in compiling #11111
dilililiwhy创建于 2024年4月11日
Involve ccache in compiling #11111
已合并
dilililiwhy创建于 2024年4月11日
refs/pull/11111/head合入到master
2 个文件变更+20-0
MCMakeLists.txt+10-0
@@ -1,5 +1,15 @@
1cmake_minimum_required(VERSION 3.18 FATAL_ERROR)1cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
2 2 
3+find_program(CCACHE ccache)
4+if(${CCACHE} STREQUAL "CCACHE-NOTFOUND")
5+ message(STATUS "Compile without ccache")
6+else()
7+ set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE} CACHE PATH "cache Compiler")
8+ set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE} CACHE PATH "cache Compiler")
9+ message(STATUS "CMAKE_C_COMPILER_LAUNCHER:${CMAKE_C_COMPILER_LAUNCHER}")
10+ message(STATUS "CMAKE_CXX_COMPILER_LAUNCHER:${CMAKE_CXX_COMPILER_LAUNCHER}")
11+endif()
12+ 
3project(TORCHNPU CXX C)13project(TORCHNPU CXX C)
4 14 
5set(LINUX TRUE)15set(LINUX TRUE)
Mexamples/libtorch_npu/CMakeLists.txt+10-0
@@ -1,5 +1,15 @@
1cmake_minimum_required(VERSION 3.13 FATAL_ERROR)1cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
2 2 
3+find_program(CCACHE ccache)
4+if(${CCACHE} STREQUAL "CCACHE-NOTFOUND")
5+ message(STATUS "Compile without ccache")
6+else()
7+ set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE} CACHE PATH "cache Compiler")
8+ set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE} CACHE PATH "cache Compiler")
9+ message(STATUS "CMAKE_C_COMPILER_LAUNCHER:${CMAKE_C_COMPILER_LAUNCHER}")
10+ message(STATUS "CMAKE_CXX_COMPILER_LAUNCHER:${CMAKE_CXX_COMPILER_LAUNCHER}")
11+endif()
12+ 
3project(LibtorchNPUDemo CXX C)13project(LibtorchNPUDemo CXX C)
4 14 
5set(LINUX TRUE)15set(LINUX TRUE)