diff --git a/core/thirdparty/CMakeLists.txt b/core/thirdparty/CMakeLists.txt index b717f4f1df..f0c6b798e8 100644 --- a/core/thirdparty/CMakeLists.txt +++ b/core/thirdparty/CMakeLists.txt @@ -33,6 +33,16 @@ else() endif() message( STATUS "Thirdparty downloaded file path: ${THIRDPARTY_DOWNLOAD_PATH}" ) +# ---------------------------------------------------------------------- +# using ccache +if( CCACHE_FOUND ) + set( EP_C_COMPILER "${CCACHE_FOUND} ${CMAKE_C_COMPILER}" ) + set( EP_CXX_COMPILER "${CCACHE_FOUND} ${CMAKE_CXX_COMPILER}" ) +else() + set( EP_C_COMPILER ${CMAKE_C_COMPILER} ) + set( EP_CXX_COMPILER ${CMAKE_CXX_COMPILER} ) +endif() + # ---------------------------------------------------------------------- # Find pthreads diff --git a/core/thirdparty/mysqlpp/CMakeLists.txt b/core/thirdparty/mysqlpp/CMakeLists.txt index 54ebd2fc64..c930d38622 100644 --- a/core/thirdparty/mysqlpp/CMakeLists.txt +++ b/core/thirdparty/mysqlpp/CMakeLists.txt @@ -32,8 +32,8 @@ macro( build_mysqlpp ) "--enable-thread-check" "CXXFLAGS=${MYSQLPP_CXX_FLAGS}" "LDFLAGS=-pthread" - "cc=${CCACHE_FOUND} ${CMAKE_C_COMPILER}" - "cxx=${CCACHE_FOUND} ${CMAKE_CXX_COMPILER}" + "cc=${EP_C_COMPILER}" + "cxx=${EP_CXX_COMPILER}" BUILD_COMMAND ${MAKE} ${MAKE_BUILD_ARGS} INSTALL_COMMAND ${MAKE} install BUILD_IN_SOURCE 1 diff --git a/core/thirdparty/profilers/CMakeLists.txt b/core/thirdparty/profilers/CMakeLists.txt index cca8a9e7cd..79a144b894 100644 --- a/core/thirdparty/profilers/CMakeLists.txt +++ b/core/thirdparty/profilers/CMakeLists.txt @@ -42,8 +42,8 @@ macro( build_libunwind ) "--prefix=" "--quiet" "--disable-tests" - "cc=${CCACHE_FOUND} ${CMAKE_C_COMPILER}" - "cxx=${CCACHE_FOUND} ${CMAKE_CXX_COMPILER}" + "cc=${EP_C_COMPILER}" + "cxx=${EP_CXX_COMPILER}" BUILD_COMMAND ${MAKE} ${MAKE_BUILD_ARGS} INSTALL_COMMAND ${MAKE} install ${EP_LOG_OPTIONS} ) @@ -78,8 +78,8 @@ macro( build_gperftools ) CONFIGURE_COMMAND /configure "--prefix=" "--quiet" - "cc=${CCACHE_FOUND} ${CMAKE_C_COMPILER}" - "cxx=${CCACHE_FOUND} ${CMAKE_CXX_COMPILER}" + "cc=${EP_C_COMPILER}" + "cxx=${EP_CXX_COMPILER}" BUILD_COMMAND ${MAKE} ${MAKE_BUILD_ARGS} INSTALL_COMMAND ${MAKE} install ${EP_LOG_OPTIONS} ) diff --git a/core/thirdparty/sqlite/CMakeLists.txt b/core/thirdparty/sqlite/CMakeLists.txt index a4f59ee909..f5b2672f65 100644 --- a/core/thirdparty/sqlite/CMakeLists.txt +++ b/core/thirdparty/sqlite/CMakeLists.txt @@ -29,8 +29,8 @@ macro( build_sqlite ) URL_MD5 "3c68eb400f8354605736cd55400e1572" CONFIGURE_COMMAND /configure "--prefix=" - "CC=${CCACHE_FOUND} ${CMAKE_C_COMPILER}" - "CXX=${CCACHE_FOUND} ${CMAKE_CXX_COMPILER}" + "CC=${EP_C_COMPILER}" + "CXX=${EP_CXX_COMPILER}" "CFLAGS=${EP_C_FLAGS}" "CXXFLAGS=-O3 -fPIC -Wno-error -fopenmp" BUILD_COMMAND ${MAKE} ${MAKE_BUILD_ARGS}