mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-02-22 15:49:57 -05:00
Gcc warning onscreen (#1701)
* Fix GCC version detection for old CMAKE * Yellow tint version number / hash on gcc mismatch
This commit is contained in:
parent
935c43e88f
commit
1b3a99cc5e
@ -34,6 +34,17 @@ set(LZ4 lz4)
|
|||||||
set(FIRMWARE_NAME portapack-h1_h2-mayhem)
|
set(FIRMWARE_NAME portapack-h1_h2-mayhem)
|
||||||
set(FIRMWARE_FILENAME ${FIRMWARE_NAME}.bin)
|
set(FIRMWARE_FILENAME ${FIRMWARE_NAME}.bin)
|
||||||
|
|
||||||
|
# In our current build container cmake need a little help to get the version :)
|
||||||
|
if(NOT DEFINED ${CMAKE_CXX_COMPILER_VERSION})
|
||||||
|
execute_process(COMMAND bash "-c" "arm-none-eabi-g++ -v 2>&1 | grep 'gcc version' | awk '{print $3}'" OUTPUT_VARIABLE CMAKE_CXX_COMPILER_VERSION)
|
||||||
|
string(STRIP ${CMAKE_CXX_COMPILER_VERSION} CMAKE_CXX_COMPILER_VERSION)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(GCC_VERSION_MISMATCH 0)
|
||||||
|
if(NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_EQUAL ${EXPECTED_GCC_VERSION})
|
||||||
|
set(GCC_VERSION_MISMATCH 1)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_subdirectory(application)
|
add_subdirectory(application)
|
||||||
add_subdirectory(baseband)
|
add_subdirectory(baseband)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
@ -52,7 +63,7 @@ add_custom_target(
|
|||||||
DEPENDS ${FIRMWARE_FILENAME} ${HACKRF_FIRMWARE_DFU_FILENAME}
|
DEPENDS ${FIRMWARE_FILENAME} ${HACKRF_FIRMWARE_DFU_FILENAME}
|
||||||
)
|
)
|
||||||
|
|
||||||
if(NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_EQUAL ${EXPECTED_GCC_VERSION})
|
if(${GCC_VERSION_MISMATCH})
|
||||||
set(COMPILER_MISMATCH_MESSAGE "WARNING: Compiler version mismatch, please use the official compiler version ${EXPECTED_GCC_VERSION} when sharing builds! Current compiler version: ${CMAKE_CXX_COMPILER_VERSION}")
|
set(COMPILER_MISMATCH_MESSAGE "WARNING: Compiler version mismatch, please use the official compiler version ${EXPECTED_GCC_VERSION} when sharing builds! Current compiler version: ${CMAKE_CXX_COMPILER_VERSION}")
|
||||||
message(${COMPILER_MISMATCH_MESSAGE})
|
message(${COMPILER_MISMATCH_MESSAGE})
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
|
@ -424,7 +424,7 @@ set(CPPWARN "-Wall -Wextra -Wno-psabi")
|
|||||||
# List all default C defines here, like -D_DEBUG=1
|
# List all default C defines here, like -D_DEBUG=1
|
||||||
# TODO: Switch -DCRT0_INIT_DATA depending on load from RAM or SPIFI?
|
# TODO: Switch -DCRT0_INIT_DATA depending on load from RAM or SPIFI?
|
||||||
# NOTE: _RANDOM_TCC to kill a GCC 4.9.3 error with std::max argument types
|
# NOTE: _RANDOM_TCC to kill a GCC 4.9.3 error with std::max argument types
|
||||||
set(DDEFS "-DLPC43XX -DLPC43XX_M0 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING=\"${VERSION}\"' -DVERSION_MD5=${VERSION_MD5}")
|
set(DDEFS "-DLPC43XX -DLPC43XX_M0 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING=\"${VERSION}\"' -DVERSION_MD5=${VERSION_MD5} -D'GCC_VERSION_MISMATCH=${GCC_VERSION_MISMATCH}'")
|
||||||
|
|
||||||
# List all default ASM defines here, like -D_DEBUG=1
|
# List all default ASM defines here, like -D_DEBUG=1
|
||||||
set(DADEFS)
|
set(DADEFS)
|
||||||
|
@ -441,7 +441,17 @@ InformationView::InformationView(
|
|||||||
&version,
|
&version,
|
||||||
<ime});
|
<ime});
|
||||||
|
|
||||||
|
#if GCC_VERSION_MISMATCH
|
||||||
|
static constexpr Style style_gcc_warning{
|
||||||
|
.font = font::fixed_8x16,
|
||||||
|
.background = {33, 33, 33},
|
||||||
|
.foreground = Color::yellow(),
|
||||||
|
};
|
||||||
|
version.set_style(&style_gcc_warning);
|
||||||
|
#else
|
||||||
version.set_style(&style_infobar);
|
version.set_style(&style_infobar);
|
||||||
|
#endif
|
||||||
|
|
||||||
ltime.set_style(&style_infobar);
|
ltime.set_style(&style_infobar);
|
||||||
refresh();
|
refresh();
|
||||||
set_dirty();
|
set_dirty();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user