mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
-#106 ARCH check in CMake, removes -msse for arm
This commit adds an architecture check to CMake, detecting if we're running on x86_64 or not. If not, disable the sse instructions. This can be improved to handle i686 and some ARM optimization.
This commit is contained in:
parent
a6f5c797ad
commit
e6ef26f33d
1 changed files with 14 additions and 4 deletions
|
@ -1,4 +1,8 @@
|
||||||
|
|
||||||
|
# Detect platform
|
||||||
|
EXECUTE_PROCESS( COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE)
|
||||||
|
message( STATUS "Architecture: ${ARCHITECTURE}" )
|
||||||
|
|
||||||
# Find depend libraries
|
# Find depend libraries
|
||||||
find_package(PkgConfig)
|
find_package(PkgConfig)
|
||||||
|
|
||||||
|
@ -36,16 +40,22 @@ IF(BUILD_TESTS)
|
||||||
ADD_DEFINITIONS(-DBUILD_TESTS)
|
ADD_DEFINITIONS(-DBUILD_TESTS)
|
||||||
ADD_DEFINITIONS(-DBUILD_COVERAGE_TEST)
|
ADD_DEFINITIONS(-DBUILD_COVERAGE_TEST)
|
||||||
|
|
||||||
SET(CMAKE_CXX_FLAGS "-g -Wall -Wextra -Wno-unused-variable -fprofile-arcs -ftest-coverage")
|
SET(CMAKE_CXX_FLAGS " -g -Wall -Wextra -Wno-unused-variable -fprofile-arcs -ftest-coverage ")
|
||||||
SET(CMAKE_C_FLAGS "-g -Wall -Wextra -W -Wno-unused-variable -fprofile-arcs -ftest-coverage")
|
SET(CMAKE_C_FLAGS " -g -Wall -Wextra -W -Wno-unused-variable -fprofile-arcs -ftest-coverage ")
|
||||||
SET(CMAKE_EXE_LINKER_FLAGS "-fprofile-arcs -ftest-coverage")
|
SET(CMAKE_EXE_LINKER_FLAGS "-fprofile-arcs -ftest-coverage")
|
||||||
ENDIF(BUILD_TESTS)
|
ENDIF(BUILD_TESTS)
|
||||||
|
|
||||||
IF(RELEASE_BUILD)
|
IF(RELEASE_BUILD)
|
||||||
SET(CMAKE_CXX_FLAGS "-g -Wall -Wno-unused-variable -msse2 -mfpmath=sse -ffast-math")
|
SET(CMAKE_CXX_FLAGS " -g -Wall -Wno-unused-variable ")
|
||||||
SET(CMAKE_C_FLAGS "-g -Wall -W -Wno-unused-variable -msse2 -mfpmath=sse -ffast-math")
|
SET(CMAKE_C_FLAGS " -g -Wall -W -Wno-unused-variable ")
|
||||||
ENDIF(RELEASE_BUILD)
|
ENDIF(RELEASE_BUILD)
|
||||||
|
|
||||||
|
if( ${ARCHITECTURE} STREQUAL "x86_64" )
|
||||||
|
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS}"-msse2" )
|
||||||
|
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}"-msse2" )
|
||||||
|
else()
|
||||||
|
# Can set i686 / ARM stuff here
|
||||||
|
endif()
|
||||||
|
|
||||||
# Add all files
|
# Add all files
|
||||||
FILE(GLOB sources *.cxx avtk/*.cxx cjson/*.c controller/*.cxx dsp/*.cxx observer/*.cxx state/*.cxx tests/*.cxx)
|
FILE(GLOB sources *.cxx avtk/*.cxx cjson/*.c controller/*.cxx dsp/*.cxx observer/*.cxx state/*.cxx tests/*.cxx)
|
||||||
|
|
Loading…
Add table
Reference in a new issue