|
| 1 | +#=============================================================================== |
| 2 | +# Copyright 2017-2018 Intel Corporation |
| 3 | +# All Rights Reserved. |
| 4 | +# |
| 5 | +# If this software was obtained under the Intel Simplified Software License, |
| 6 | +# the following terms apply: |
| 7 | +# |
| 8 | +# The source code, information and material ("Material") contained herein is |
| 9 | +# owned by Intel Corporation or its suppliers or licensors, and title to such |
| 10 | +# Material remains with Intel Corporation or its suppliers or licensors. The |
| 11 | +# Material contains proprietary information of Intel or its suppliers and |
| 12 | +# licensors. The Material is protected by worldwide copyright laws and treaty |
| 13 | +# provisions. No part of the Material may be used, copied, reproduced, |
| 14 | +# modified, published, uploaded, posted, transmitted, distributed or disclosed |
| 15 | +# in any way without Intel's prior express written permission. No license under |
| 16 | +# any patent, copyright or other intellectual property rights in the Material |
| 17 | +# is granted to or conferred upon you, either expressly, by implication, |
| 18 | +# inducement, estoppel or otherwise. Any license under such intellectual |
| 19 | +# property rights must be express and approved by Intel in writing. |
| 20 | +# |
| 21 | +# Unless otherwise agreed by Intel in writing, you may not remove or alter this |
| 22 | +# notice or any other notice embedded in Materials by Intel or Intel's |
| 23 | +# suppliers or licensors in any way. |
| 24 | +# |
| 25 | +# |
| 26 | +# If this software was obtained under the Apache License, Version 2.0 (the |
| 27 | +# "License"), the following terms apply: |
| 28 | +# |
| 29 | +# You may not use this file except in compliance with the License. You may |
| 30 | +# obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 |
| 31 | +# |
| 32 | +# |
| 33 | +# Unless required by applicable law or agreed to in writing, software |
| 34 | +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 35 | +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 36 | +# |
| 37 | +# See the License for the specific language governing permissions and |
| 38 | +# limitations under the License. |
| 39 | +#=============================================================================== |
| 40 | + |
| 41 | +# |
| 42 | +# Intel(R) Integrated Performance Primitives (Intel(R) IPP) Cryptography |
| 43 | +# |
| 44 | + |
| 45 | +# compiler |
| 46 | +set(CC_FLAGS_INLINE_ASM_UNIX_IA32 "-fasm-blocks -use_msasm -w -m32 -fomit-frame-pointer") |
| 47 | + |
| 48 | +set(CC_FLAGS_INLINE_ASM_UNIX_INTEL64 "-fasm-blocks -use_msasm -ffixed-rdi -ffixed-rsi -ffixed-rbx -ffixed-rcx -ffixed-rdx -ffixed-rbp -ffixed-r8 -ffixed-r9 -ffixed-r12 -ffixed-r13 -ffixed-r14 -ffixed-r15") |
| 49 | + |
| 50 | +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} ${LIBRARY_DEFINES}") |
| 51 | + |
| 52 | +# Ensures that compilation takes place in a freestanding environment |
| 53 | +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffreestanding") |
| 54 | +# Determines whether pointer disambiguation is enabled with the restrict qualifier |
| 55 | +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -restrict") |
| 56 | +# Tells the compiler to generate an optimization report |
| 57 | +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -qopt-report2 -qopt-report-phase:vec") |
| 58 | +# Tells the compiler to align functions and loops. |
| 59 | +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -falign-functions=32 -falign-loops=32") |
| 60 | +# Other flags |
| 61 | +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -diag-error 266 -diag-disable 13366") |
| 62 | + |
| 63 | +# Security Compiler flags |
| 64 | + |
| 65 | +# Stack-based Buffer Overrun Detection |
| 66 | +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector") |
| 67 | + |
| 68 | +# Format string vulnerabilities |
| 69 | +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wformat -Wformat-security") |
| 70 | + |
| 71 | +if(NOT NONPIC_LIB) |
| 72 | + # Position Independent Execution (PIE) |
| 73 | + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fpic -fPIC") |
| 74 | +endif() |
| 75 | + |
| 76 | +# Specifying a Target Platform as Android |
| 77 | +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -platform=android") |
| 78 | + |
| 79 | +if(THREADED_LIB) |
| 80 | + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -qopenmp -qopenmp-lib compat") |
| 81 | +endif() |
| 82 | +if(CODE_COVERAGE) |
| 83 | + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -prof-gen:srcpos -prof-dir ${PROF_DATA_DIR}") |
| 84 | +endif() |
| 85 | + |
| 86 | +set (CMAKE_C_FLAGS_RELEASE " -O3 -DNDEBUG -w3" CACHE STRING "" FORCE) |
| 87 | +set (CMAKE_C_FLAGS_RELEASE_INIT " -O3 -DNDEBUG -w3" CACHE STRING "" FORCE) |
| 88 | + |
| 89 | +if(${ARCH} MATCHES "ia32") |
| 90 | + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -no-sox -Zp16 -gcc -falign-stack=maintain-16-byte -Wa,--32 -no-use-asm -m32") |
| 91 | +else() |
| 92 | + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -no-sox -Zp16 -gcc") |
| 93 | +endif(${ARCH} MATCHES "ia32") |
| 94 | + |
| 95 | +set(w7_opt "${w7_opt} -xSSE2") |
| 96 | +set(s8_opt "${s8_opt} -xATOM_SSSE3 -minstruction=nomovbe") |
| 97 | +set(p8_opt "${p8_opt} -xATOM_SSE4.2 -minstruction=nomovbe") |
| 98 | +set(g9_opt "${g9_opt} -xAVX") |
| 99 | +set(h9_opt "${h9_opt} -xCORE-AVX2") |
| 100 | +set(m7_opt "${m7_opt} -xSSE3") |
| 101 | +set(n8_opt "${n8_opt} -xATOM_SSSE3 -minstruction=nomovbe") |
| 102 | +set(y8_opt "${y8_opt} -xATOM_SSE4.2 -minstruction=nomovbe") |
| 103 | +set(e9_opt "${e9_opt} -xAVX") |
| 104 | +set(l9_opt "${l9_opt} -xCORE-AVX2") |
| 105 | +set(n0_opt "${n0_opt} -xMIC-AVX512") |
| 106 | +set(k0_opt "${k0_opt} -xCORE-AVX512") |
| 107 | +set(k0_opt "${k0_opt} -qopt-zmm-usage:high") |
0 commit comments