File: native.cmake

package info (click to toggle)
espresso 6.7-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 311,068 kB
  • sloc: f90: 447,429; ansic: 52,566; sh: 40,631; xml: 37,561; tcl: 20,077; lisp: 5,923; makefile: 4,503; python: 4,379; perl: 1,219; cpp: 761; fortran: 618; java: 568; awk: 128
file content (14 lines) | stat: -rw-r--r-- 520 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Auto-detect uarch of the build machine and automatically codegen for it
# Be aware that resulting binaries will be unportable even across same arch but different uarch

set(flags "-O3 -DNDEBUG -march=native -mtune=native")

# Release
set(CMAKE_C_FLAGS_RELEASE   "${flags}" CACHE STRING "")
set(CMAKE_Fortran_FLAGS_RELEASE "${flags}" CACHE STRING "")

# RelWithDebInfo
set(CMAKE_C_FLAGS_RELWITHDEBINFO   "${flags} -g" CACHE STRING "")
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${flags} -g" CACHE STRING "")

unset(flags)