File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ configure_file (
4343include_directories (${CMAKE_BINARY_DIR} /generated )
4444
4545option (BUILD_SHARED_LIBS "Build the shared library" ON )
46+ option (COMPILER_ARCHITECTURE "Compiler -march argument" "native" )
4647
4748set (CMAKE_COLOR_MAKEFILE ON )
4849
Original file line number Diff line number Diff line change @@ -372,6 +372,8 @@ def main(args):
372372 cmake_options .append ("-DBUILD_SHARED_LIBS=OFF" )
373373 if args ["verbose" ]:
374374 cmake_options .append ("-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON" )
375+ if args ["architecture" ]:
376+ cmake_options .append ("-DCOMPILER_ARCHITECTURE=" + args ["architecture" ])
375377 if dependencies_dir is not None :
376378 if args ["c_compiler" ]:
377379 cmake_options .append ("-DCMAKE_C_COMPILER=" + str (args ["c_compiler" ]))
@@ -506,5 +508,9 @@ def main(args):
506508 default = False ,
507509 help = 'Ouput verbose make information' ,
508510 action = 'store_true' )
511+ parser .add_argument ('--architecture' ,
512+ required = False ,
513+ type = str ,
514+ help = 'The architecture to compile for' )
509515 args = vars (parser .parse_args ())
510516 main (args )
Original file line number Diff line number Diff line change @@ -657,7 +657,7 @@ if (NOT BUILD_SHARED_LIBS)
657657 set (HTSlib_USE_STATIC_LIBS ON )
658658endif ()
659659
660- set (CXX_OPTIMIZATION_FLAGS -ffast-math -march=native )
660+ set (CXX_OPTIMIZATION_FLAGS -ffast-math -march=${COMPILER_ARCHITECTURE} )
661661if (CMAKE_COMPILER_IS_GNUCXX)
662662 set (CXX_OPTIMIZATION_FLAGS ${CXX_OPTIMIZATION_FLAGS} -mfpmath=both)
663663endif ()
You can’t perform that action at this time.
0 commit comments