summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-08-15 04:29:08 +0200
committerbunnei <bunneidev@gmail.com>2015-08-16 00:03:27 +0200
commitb39c053785abc4a94ce380885a846c5d8be89675 (patch)
tree42911208a051652a7452c8bbbd35ec91aa2d4e20 /CMakeLists.txt
parentCommon: Cleanup CPU capability detection code. (diff)
downloadyuzu-b39c053785abc4a94ce380885a846c5d8be89675.tar
yuzu-b39c053785abc4a94ce380885a846c5d8be89675.tar.gz
yuzu-b39c053785abc4a94ce380885a846c5d8be89675.tar.bz2
yuzu-b39c053785abc4a94ce380885a846c5d8be89675.tar.lz
yuzu-b39c053785abc4a94ce380885a846c5d8be89675.tar.xz
yuzu-b39c053785abc4a94ce380885a846c5d8be89675.tar.zst
yuzu-b39c053785abc4a94ce380885a846c5d8be89675.zip
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt27
1 files changed, 14 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 17a0a9761..00d71dbdc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,9 +10,21 @@ if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git/hooks/pre-commit)
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/.git/hooks)
endif()
+# Platform-agnostic definition to check if we are on x86_64
+if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "[xX]86_64" OR
+ ${CMAKE_SYSTEM_PROCESSOR} MATCHES "[aA][mM][dD]64")
+ set(ARCHITECTURE_x86_64 1)
+ add_definitions(-DARCHITECTURE_x86_64=1)
+endif()
+
if (NOT MSVC)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-attributes -pthread -msse4.2")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread -msse4.2")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-attributes -pthread")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
+
+ if (ARCHITECTURE_x86_64)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.1")
+ endif()
else()
# Silence "deprecation" warnings
add_definitions(/D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE)
@@ -51,17 +63,6 @@ else()
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG /INCREMENTAL:NO /OPT:REF,ICF" CACHE STRING "" FORCE)
endif()
-# Platform-agnostic definition to check if we are on x86_64
-if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86" OR
- ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86" OR
- ${CMAKE_SYSTEM_PROCESSOR} MATCHES "[aA][mM][dD]64" OR
- APPLE)
- if(CMAKE_SIZEOF_VOID_P EQUAL 8)
- set(ARCHITECTURE_X64 1)
- add_definitions(-DARCHITECTURE_X64=1)
- endif()
-endif()
-
add_definitions(-DSINGLETHREADED)
# CMake seems to only define _DEBUG on Windows
set_property(DIRECTORY APPEND PROPERTY