From 77b8f3a0f9780d5f4c79ddaa9e38ea429f723b6f Mon Sep 17 00:00:00 2001 From: Zion Nimchuk Date: Sun, 18 Feb 2018 19:55:46 -0800 Subject: [PATCH] Add an easy way for package builders to disable native cpu optimizations --- CMakeLists.txt | 1 + README.md | 3 +++ rpcs3/CMakeLists.txt | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d7e10b372e..a082fcbcde 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.1) option(WITH_GDB "WITH_GDB" OFF) option(WITHOUT_LLVM "WITHOUT_LLVM" OFF) +option(USE_NATIVE_INSTRUCTIONS "USE_NATIVE_INSTRUCTIONS makes rpcs3 compile with -march=native, which is useful for local builds, but not good for packages." ON) if (WITH_GDB) add_definitions(-DWITH_GDB_DEBUGGER) diff --git a/README.md b/README.md index 7f7566e4d1..12173aea30 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,9 @@ This Builds RPCS3 with support for debugging PS3 games using gdb. - ```-DUSE_VULKAN=ON/OFF``` (default = *ON*) This builds RPCS3 with Vulkan support. +- ```-DUSE_NATIVE_INSTRUCTIONS=ON/OFF``` (default = *ON*) +This builds rpcs3 with -march=native, which is useful for local builds, but not good for packages. + ## License Most files are licensed under the terms of GNU GPLv2 License, see LICENSE file for details. Some files may be licensed differently, check appropriate file headers for details. diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index 0fc8c8cc90..acf359a69a 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -108,7 +108,7 @@ if(NOT MSVC) add_compile_options(-msse -msse2 -mcx16 -mrtm) - if(NOT DEFINED ENV{TRAVIS}) + if(NOT DEFINED ENV{TRAVIS} AND USE_NATIVE_INSTRUCTIONS) add_compile_options(-march=native) endif()