|
| 1 | + |
1 | 2 | SET( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE )
|
2 | 3 | SET( CMAKE_VERBOSE_MAKEFILE TRUE )
|
3 | 4 |
|
4 | 5 | # /Gd Uses the __cdecl calling convention (x86 only).
|
5 |
| -# /Gr Uses the __fastcall calling convention (x86 only). |
6 |
| -# /Gv Uses the __vectorcall calling convention. (x86 and x64 only) |
7 |
| -# /Gz Uses the __stdcall calling convention (x86 only). |
| 6 | +# /Gr Uses the __fastcall calling convention (x86 only). |
| 7 | +# /Gv Uses the __vectorcall calling convention. (x86 and x64 only) |
| 8 | +# /Gz Uses the __stdcall calling convention (x86 only). |
| 9 | + |
| 10 | +SET( CXX_WARN "-Wall -Wno-float-equal -Wno-padded ") |
| 11 | +SET( CLANG_WARN "-Wall -Wno-alloca -Wno-cast-align -Wno-cast-qual -Wno-conversion -Wno-c++2a-compat -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-format-nonliteral -Wno-implicit-fallthrough -Wno-documentation -Wno-float-equal -Wno-padded -Wno-reserved-id-macro -Wno-unreachable-code-break -Wno-unused-macros -Wno-switch-enum -Wno-sign-conversion -Wno-signed-enum-bitfield -Wno-weak-vtables ") |
| 12 | +SET( VS_WARN "") |
8 | 13 |
|
9 | 14 | IF( CMAKE_CXX_COMPILER_ID MATCHES "GNU" )
|
10 |
| - SET( CMAKE_CXX_FLAGS "-std=c++11 " ) |
11 |
| - SET( CMAKE_CXX_FLAGS_RELEASE "-fPIC -Wall -Wno-float-equal -Wno-padded -funroll-loops -O2 -g " ) |
12 |
| - SET( CMAKE_CXX_FLAGS_DEBUG "-fPIC -Wall -Wno-float-equal -Wno-padded -O0 -g -DMECHATRONIX_DEBUG -DDEBUG " ) |
| 15 | + SET( CMAKE_CXX_FLAGS "-std=c++11 " ) |
| 16 | + SET( CMAKE_CXX_FLAGS_RELEASE "-fPIC -fopenmp -O2 -g -floop-interchange -floop-block -funroll-loops ${CXX_WARN}" ) |
| 17 | + SET( CMAKE_CXX_FLAGS_DEBUG "-fPIC -fopenmp -O0 -ggdb -DMECHATRONIX_DEBUG -DDEBUG ${CXX_WARN}" ) |
13 | 18 | ELSEIF( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
14 |
| - SET( CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ " ) |
15 |
| - SET( CMAKE_CXX_FLAGS_RELEASE "-fPIC -Weverything -Wno-weak-vtables -Wno-implicit-fallthrough -Wno-documentation-unknown-command -Wno-float-equal -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded -Wno-reserved-id-macro -Wno-documentation -funroll-loops -O2 -g " ) |
16 |
| - SET( CMAKE_CXX_FLAGS_DEBUG "-fPIC -Weverything -Wno-weak-vtables -Wno-implicit-fallthrough -Wno-documentation-unknown-command -Wno-float-equal -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded -Wno-reserved-id-macro -Wno-documentation -O0 -gfull -DMECHATRONIX_DEBUG -DDEBUG " ) |
| 19 | + SET( CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ " ) |
| 20 | + SET( CMAKE_CXX_FLAGS_RELEASE "-fPIC -Os -g -finline-functions -finline-hint-functions -funroll-loops -fcolor-diagnostics ${CLANG_WARN}" ) |
| 21 | + SET( CMAKE_CXX_FLAGS_DEBUG "-fPIC -O0 -gfull -fcolor-diagnostics -DMECHATRONIX_DEBUG -DDEBUG ${CLANG_WARN}" ) |
17 | 22 | ELSEIF( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
|
18 |
| - SET( CMAKE_CXX_FLAGS_RELEASE "/nologo /GS /W3 /WX- /Gm- /fp:precise /EHsc /D_WINDOWS /D_SCL_SECURE_NO_WARNINGS /DHAVE_STRING_H /DNO_GETTIMEOFDAY /DYAML_DECLARE_STATIC /DPCRE_STATIC /O2 /MD " ) |
19 |
| - SET( CMAKE_CXX_FLAGS_DEBUG "/nologo /GS /W3 /WX- /Gm- /fp:precise /EHsc /D_WINDOWS /D_SCL_SECURE_NO_WARNINGS /DHAVE_STRING_H /DNO_GETTIMEOFDAY /DYAML_DECLARE_STATIC /DPCRE_STATIC /Od /Ob0 /MDd /Z7 /RTC1 /D_DEBUG /DMECHATRONIX_DEBUG " ) |
| 23 | + SET( CMAKE_CXX_FLAGS "" ) |
| 24 | + SET( CMAKE_CXX_FLAGS_RELEASE "/nologo /GS /W3 /WX- /EHsc /bigobj /D_WINDOWS /D_SCL_SECURE_NO_WARNINGS /DHAVE_STRING_H /DNO_GETTIMEOFDAY /DYAML_DECLARE_STATIC /DPCRE_STATIC /O2 /MD ${VS_WARN}" ) |
| 25 | + SET( CMAKE_CXX_FLAGS_DEBUG "/nologo /GS /W3 /WX- /EHsc /bigobj /D_WINDOWS /D_SCL_SECURE_NO_WARNINGS /DHAVE_STRING_H /DNO_GETTIMEOFDAY /DYAML_DECLARE_STATIC /DPCRE_STATIC /Od /Ob0 /MDd /RTC1 /guard:cf /Zi /D_DEBUG /DMECHATRONIX_DEBUG ${VS_WARN}" ) |
20 | 26 | ELSE()
|
21 | 27 | MESSAGE( FATAL_ERROR "Unsupported compiler ${CMAKE_CXX_COMPILER_ID}")
|
22 | 28 | ENDIF()
|
23 | 29 |
|
24 | 30 | MESSAGE( STATUS "Compiler used: ${CMAKE_CXX_COMPILER_ID}")
|
25 | 31 |
|
| 32 | +SET( CMAKE_C_FLAGS "" ) |
26 | 33 | SET( CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE} )
|
27 | 34 | SET( CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG} )
|
| 35 | + |
| 36 | +# select LAPACK library to be used |
| 37 | +SET( PINS_USE_ACCELERATE true ) |
| 38 | + |
| 39 | +# check if link against static libgcc |
| 40 | +SET( PINS_USE_STATIC_LIBGCC false ) |
| 41 | + |
| 42 | +SET( PINS_ON_RASPBERRY false ) |
0 commit comments