cmake: Use CMAKE_CXX_COMPILER_ID

SD_BUILD_INFO_COMPILER_NAME is redundant since CMAKE_CXX_COMPILER_ID can
already be used for this purpose, even if their values are not
identical.
This commit is contained in:
Xavier Del Campo Romero 2025-01-17 06:39:58 +01:00
parent 14a19abcc6
commit c5266013fc
Signed by: xavi
GPG key ID: 84FF3612A9BF43F2
2 changed files with 7 additions and 13 deletions

View file

@ -74,6 +74,12 @@ else()
message(STATUS "Data directory: ${SD_DATADIR_ABS}")
endif()
if(CMAKE_CXX_COMPILER_ID)
set(SD_BUILD_INFO_COMPILER_NAME ${CMAKE_CXX_COMPILER_ID})
else()
set(SD_BUILD_INFO_COMPILER_NAME "Unknown")
endif()
INCLUDE(cmake/macros.cmake)
INCLUDE(cmake/checks.cmake)

View file

@ -159,19 +159,7 @@
# define SD_BUILD_INFO_CONFIGURATION "${CMAKE_BUILD_TYPE}"
#endif
#if defined(_MSC_VER)
# define SD_BUILD_INFO_COMPILER_NAME "MSC"
#elif defined(__GNUC__)
# if defined(__MINGW32__)
# define SD_BUILD_INFO_COMPILER_NAME "MinGW GCC"
# elif defined(__INTEL_COMPILER)
# define SD_BUILD_INFO_COMPILER_NAME "Intel"
# else
# define SD_BUILD_INFO_COMPILER_NAME "GCC"
# endif
#else
# define SD_BUILD_INFO_COMPILER_NAME "Unknown"
#endif
#define SD_BUILD_INFO_COMPILER_NAME "${SD_BUILD_INFO_COMPILER_NAME}"
/* Run-time directories */
#define SD_DATADIR "${SD_DATADIR}/"