Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build][Bugfix] Use CMAKE_ prefix for <LANG>_COMPILER_LAUNCHER #13697

Merged
merged 1 commit into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cmake/utils/CCache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
# under the License.

if(USE_CCACHE) # True for AUTO, ON, /path/to/ccache
if(DEFINED CXX_COMPILER_LAUNCHER OR DEFINED C_COMPILER_LAUNCHER)
if(DEFINED CMAKE_CXX_COMPILER_LAUNCHER OR DEFINED CMAKE_C_COMPILER_LAUNCHER)
if("${USE_CCACHE}" STREQUAL "AUTO")
message(STATUS "CXX_COMPILER_LAUNCHER or C_COMPILER_LAUNCHER already defined, not using ccache")
message(STATUS "CMAKE_CXX_COMPILER_LAUNCHER or CMAKE_C_COMPILER_LAUNCHER already defined, not using ccache")
elseif("${USE_CCACHE}" MATCHES ${IS_TRUE_PATTERN})
message(FATAL_ERROR "CXX_COMPILER_LAUNCHER or C_COMPILER_LAUNCHER is already defined, refusing to override with ccache. Either unset or disable ccache.")
message(FATAL_ERROR "CMAKE_CXX_COMPILER_LAUNCHER or CMAKE_C_COMPILER_LAUNCHER is already defined, refusing to override with ccache. Either unset or disable ccache.")
endif()
else()
if("${USE_CCACHE}" STREQUAL "AUTO") # Auto mode
Expand All @@ -45,8 +45,8 @@ if(USE_CCACHE) # True for AUTO, ON, /path/to/ccache
endif()
# Set the flag for ccache
if(DEFINED PATH_TO_CCACHE)
set(CXX_COMPILER_LAUNCHER "${PATH_TO_CCACHE}")
set(C_COMPILER_LAUNCHER "${PATH_TO_CCACHE}")
set(CMAKE_CXX_COMPILER_LAUNCHER "${PATH_TO_CCACHE}")
set(CMAKE_C_COMPILER_LAUNCHER "${PATH_TO_CCACHE}")
endif()
endif()
endif(USE_CCACHE)
2 changes: 1 addition & 1 deletion cmake/utils/Summary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ macro(print_summary)
message(STATUS " C++ compiler ID : ${CMAKE_CXX_COMPILER_ID}")
message(STATUS " C++ compiler version : ${CMAKE_CXX_COMPILER_VERSION}")
message(STATUS " CXX flags : ${CMAKE_CXX_FLAGS}")
message(STATUS " CXX launcher : ${CXX_COMPILER_LAUNCHER}")
message(STATUS " CXX launcher : ${CMAKE_CXX_COMPILER_LAUNCHER}")
message(STATUS " Linker flags : ${CMAKE_SHARED_LINKER_FLAGS}")
message(STATUS " Build type : ${CMAKE_BUILD_TYPE}")
get_directory_property(READABLE_COMPILE_DEFS DIRECTORY ${PROJECT_SOURCE_DIR} COMPILE_DEFINITIONS)
Expand Down