Skip to content

Commit

Permalink
portable compilation flag
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamchandak94 committed Nov 14, 2020
1 parent c6707b9 commit 42ab933
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,20 @@ if(result)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()

option(spring_optimize_for_native "Build spoa with -march=native" ON)
option(spring_optimize_for_portability "Build spoa with -msse4.1" OFF)

message(STATUS "Setting compiler flags")
#set(FLAGS "${FLAGS} -g")
#set(FLAGS "${FLAGS} -Wextra")
#set(FLAGS "${FLAGS} -Wpedantic")
#set(FLAGS "${FLAGS} -Wall")
set(FLAGS "${FLAGS} -O3")
set(FLAGS "${FLAGS} -march=native")
if (spring_optimize_for_portability)
set(FLAGS "${FLAGS} -msse4.1")
elseif (spring_optimize_for_native)
set(FLAGS "${FLAGS} -march=native")
endif ()
set(FLAGS "${FLAGS} -fomit-frame-pointer")
set(FLAGS "${FLAGS} -fstrict-aliasing")
set(FLAGS "${FLAGS} -ffast-math")
Expand Down

0 comments on commit 42ab933

Please sign in to comment.