Mentions légales du service

Skip to content
Snippets Groups Projects
Commit ec4abaea authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

cmake: check for fallthrough attribute

parent c3f07d09
No related branches found
No related tags found
1 merge request!266Fix many issues
......@@ -503,13 +503,32 @@ else (NOT CHAMELEON_SIMULATION)
endif(NOT CHAMELEON_SIMULATION)
# getopt
# Check for getopt
# ----------------
unset(CMAKE_REQUIRED_LIBRARIES)
check_include_files(getopt.h CHAMELEON_HAVE_GETOPT_H)
if (CHAMELEON_HAVE_GETOPT_H)
check_function_exists(getopt_long CHAMELEON_HAVE_GETOPT_LONG)
endif()
# Check for attribute fallthrough
# -------------------------------
check_c_source_compiles("
#include <stdarg.h>
int main(void) {
int a = 2;
switch( a ){
case 0:
__attribute__((fallthrough));
default:
;
}
return 0;
}
"
HAVE_FALLTHROUGH
)
# Add option to exploit cublas API v2
# -----------------------------------
cmake_dependent_option(CHAMELEON_USE_CUBLAS_V2
......
......@@ -70,6 +70,13 @@
/* chameleon runtime starpu */
#cmakedefine CHAMELEON_ENABLE_PRUNING_STATS
#cmakedefine HAVE_FALLTHROUGH
#if defined(HAVE_FALLTHROUGH)
#define chameleon_attr_fallthrough __attribute__((fallthrough))
#else
#define chameleon_attr_fallthrough do {} while(0)
#endif
#ifdef BEGIN_C_DECLS
#undef BEGIN_C_DECLS
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment