Updated CMakeLists to compile with correct flags and settings
This commit is contained in:
parent
3738012c3e
commit
92fb5c1d76
@ -1,17 +1,27 @@
|
||||
cmake_minimum_required (VERSION 3.16)
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(LASP LANGUAGES C CXX VERSION 1.1)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED)
|
||||
|
||||
option(LASP_DOUBLE_PRECISION "Compile as double precision floating point" ON)
|
||||
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
|
||||
set(RPI TRUE)
|
||||
else()
|
||||
set(RPI FALSE)
|
||||
endif()
|
||||
|
||||
# Setting defaults for PortAudio and RtAudio backend, depending on Linux /
|
||||
# Windows.
|
||||
set(DEFAULT_DOUBLE_PRECISION ON)
|
||||
if(WIN32)
|
||||
set(DEFAULT_RTAUDIO OFF)
|
||||
set(DEFAULT_PORTAUDIO ON)
|
||||
set(DEFAULT_ULDAQ OFF)
|
||||
elseif(${RPI})
|
||||
set(DEFAULT_RTAUDIO OFF)
|
||||
set(DEFAULT_PORTAUDIO ON)
|
||||
set(DEFAULT_ULDAQ OFF)
|
||||
|
||||
else()
|
||||
set(DEFAULT_RTAUDIO OFF)
|
||||
set(DEFAULT_PORTAUDIO ON)
|
||||
@ -19,6 +29,7 @@ else()
|
||||
endif()
|
||||
|
||||
|
||||
option(LASP_DOUBLE_PRECISION "Compile as double precision floating point" ${DEFAULT_DOUBLE_PRECISION})
|
||||
option(LASP_HAS_RTAUDIO "Compile with RtAudio Daq backend" ${DEFAULT_RTAUDIO})
|
||||
option(LASP_HAS_PORTAUDIO "Compile with PortAudio Daq backend" ${DEFAULT_PORTAUDIO})
|
||||
if(LASP_HAS_PORTAUDIO AND LASP_HAS_RTAUDIO)
|
||||
@ -105,13 +116,17 @@ else()
|
||||
endif()
|
||||
|
||||
# ###################################### Compilation flags
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O3 -flto -mfpmath=sse -march=x86-64 -mtune=native \
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O3 -flto -mtune=native \
|
||||
-fdata-sections -ffunction-sections -fomit-frame-pointer -finline-functions")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-type-limits -Werror=return-type")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -flto -mfpmath=sse -march=x86-64 -mtune=native \
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -flto -mtune=native \
|
||||
-fdata-sections -ffunction-sections -fomit-frame-pointer -finline-functions")
|
||||
|
||||
if(NOT ${RPI})
|
||||
set(CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE} -mfpmath=sse -march=x86-64)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE} -mfpmath=sse -march=x86-64)
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wall ")
|
||||
|
||||
# ############################# End compilation flags
|
||||
|
Loading…
Reference in New Issue
Block a user