From 0d5cb0536e3077844761f990b2a87132a96c72d7 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Thu, 9 Mar 2017 18:08:09 -0500 Subject: [PATCH] - enable multiprocessor compilation with MSVC++ using /MP for MSBuild - Target NEON processors for ARM. --- src/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d50274473..37746a89e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -413,6 +413,11 @@ else( X64 ) set( CMAKE_CXX_FLAGS ${SAFE_CMAKE_CXX_FLAGS} ) endif( X64 ) +# Set up flags for MSVC +if (MSVC) + set( CMAKE_CXX_FLAGS "/MP ${CMAKE_CXX_FLAGS}" ) +endif (MSVC) + # Set up flags for GCC if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE ) @@ -471,6 +476,11 @@ if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE ) set( CMAKE_C_FLAGS "-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-missing-field-initializers -ffp-contract=off ${CMAKE_C_FLAGS}" ) set( CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-missing-field-initializers -ffp-contract=off ${CMAKE_CXX_FLAGS}" ) + # ARM processors (Raspberry Pi, et al) - enable ARM NEON support. + if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") + set( CMAKE_CXX_FLAGS "-mfpu=neon ${CMAKE_CXX_FLAGS}" ) + endif () + # Use the highest C++ standard available since VS2015 compiles with C++14 # but we only require C++11. The recommended way to do this in CMake is to # probably to use target_compile_features, but I don't feel like maintaining