mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-14 00:37:44 -04:00
Posix_GCC: update compiler options (#1227)
Posix_GCC: update compiler options 1. Add to CFLAGS - add -O0 optimization for debug builds. - add -O3 optimization for release builds. 2. Update signal handler `handle_sigint()` to use `_exit()` instead of `exit()`. Normal exit() is not allowed within a signal handler. Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
This commit is contained in:
parent
995a030a92
commit
5f85f43c39
2 changed files with 6 additions and 1 deletions
|
@ -4,6 +4,8 @@ project( posix_demo )
|
||||||
|
|
||||||
add_compile_options( -D_WINDOWS_ )
|
add_compile_options( -D_WINDOWS_ )
|
||||||
|
|
||||||
|
add_compile_options( -Wall -Wextra -Wpedantic )
|
||||||
|
|
||||||
if( TRACE_ON_ENTER )
|
if( TRACE_ON_ENTER )
|
||||||
add_compile_options( -DTRACE_ON_ENTER=1 )
|
add_compile_options( -DTRACE_ON_ENTER=1 )
|
||||||
else()
|
else()
|
||||||
|
@ -33,6 +35,9 @@ else()
|
||||||
set( CMAKE_BUILD_TYPE "debug" )
|
set( CMAKE_BUILD_TYPE "debug" )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3")
|
||||||
|
|
||||||
if( SANITIZE_ADDRESS )
|
if( SANITIZE_ADDRESS )
|
||||||
add_compile_options( -fsanitize=address -fsanitize=alignment )
|
add_compile_options( -fsanitize=address -fsanitize=alignment )
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -455,7 +455,7 @@ void handle_sigint( int signal )
|
||||||
printf( "chdir into %s error is %d\n", BUILD, errno );
|
printf( "chdir into %s error is %d\n", BUILD, errno );
|
||||||
}
|
}
|
||||||
|
|
||||||
exit( 2 );
|
_exit( 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue