| 1 |
include(Pj/DetectArch) |
| 2 |
pj_detect_arch(arch) |
| 3 |
pj_detect_arch_simd_ext(simd_inst simd_flags) |
| 4 |
|
| 5 |
set(WEBRTC_ARCH "${arch}") |
| 6 |
set(WEBRTC_ARCH_SIMD "${simd_inst}") |
| 7 |
set(WEBRTC_COMPILE_OPTIONS ${simd_flags}) |
| 8 |
set(WEBRTC_COMPILE_DEFINITIONS WEBRTC_APM_DEBUG_DUMP=0) |
| 9 |
|
| 10 |
# operating system definitions |
| 11 |
if(IOS) |
| 12 |
list(APPEND WEBRTC_COMPILE_DEFINITIONS WEBRTC_IOS=1 WEBRTC_POSIX=1) |
| 13 |
elseif(DARWIN) |
| 14 |
list(APPEND WEBRTC_COMPILE_DEFINITIONS WEBRTC_MAC=1 WEBRTC_POSIX=1) |
| 15 |
elseif(ANDROID) |
| 16 |
list(APPEND WEBRTC_COMPILE_DEFINITIONS WEBRTC_ANDROID=1 WEBRTC_POSIX=1) |
| 17 |
elseif(LINUX) |
| 18 |
list(APPEND WEBRTC_COMPILE_DEFINITIONS WEBRTC_LINUX=1 WEBRTC_POSIX=1) |
| 19 |
elseif(WIN32) |
| 20 |
list(APPEND WEBRTC_COMPILE_DEFINITIONS WEBRTC_WIN=1) |
| 21 |
endif() |
| 22 |
|
| 23 |
if (MSVC) |
| 24 |
list(APPEND WEBRTC_COMPILE_DEFINITIONS NOMINMAX) |
| 25 |
endif() |
| 26 |
|
| 27 |
# architecture definitions |
| 28 |
if(arch STREQUAL "arm64") |
| 29 |
list(APPEND WEBRTC_COMPILE_DEFINITIONS WEBRTC_ARCH_ARM64=1) |
| 30 |
elseif(arch STREQUAL "mips") |
| 31 |
list(APPEND WEBRTC_COMPILE_DEFINITIONS MIPS_FPU_LE=1) |
| 32 |
endif() |
| 33 |
|
| 34 |
if(simd_inst STREQUAL "neon") |
| 35 |
list(APPEND WEBRTC_COMPILE_DEFINITIONS WEBRTC_HAS_NEON=1) |
| 36 |
endif() |