-
Notifications
You must be signed in to change notification settings - Fork 257
/
CMakeLists.txt
51 lines (41 loc) · 1.77 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#
# Copyright(c) 2018 Intel Corporation
# SPDX - License - Identifier: BSD - 2 - Clause - Patent
#
cmake_minimum_required(VERSION 3.5)
set(project_name "svt-av1")
project(${project_name} C ASM_NASM)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/bin)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_C_STANDARD 99)
set(CAN_USE_ASSEMBLER TRUE)
set(CMAKE_NASM_LINK_EXECUTABLE "ld -o <TARGET> <OBJECTS>")
set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS asm)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
set(CMAKE_ASM_NASM_FLAGS "-DUNIX64")
set(CMAKE_MACOSX_RPATH 1)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(CMAKE_C_FLAGS "-Wall -Wextra -Wformat -Wformat-security -mavx2 -fstack-protector-strong -fPIE -fPIC -D_FORTIFY_SOURCE=2 ")
set(CMAKE_C_FLAGS_RELEASE "-O2")
set(CMAKE_C_FLAGS_DEBUG "-O0 -g")
SET(CMAKE_EXE_LINKER_FLAGS "-z noexecstack -z relro -z now -pie ")
SET(CMAKE_SHARED_LINKER_FLAGS "-z noexecstack -z relro -z now -pie ")
set(CMAKE_ASM_NASM_FLAGS "-DUNIX64")
set(CMAKE_ASM_NASM_FLAGS_DEBUG "-g null")
set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(CMAKE_EXE_LINKER_FLAGS " ")
set(CMAKE_SHARED_LINKER_FLAGS " ")
set(CMAKE_C_FLAGS_RELEASE "-O2")
set(CMAKE_ASM_NASM_FLAGS "-DWIN64")
set(CMAKE_ASM_NASM_FLAGS_DEBUG "")
endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
# Add Subdirectories
add_subdirectory (Source/Lib)
add_subdirectory (Source/App)
add_subdirectory (Source/SimpleApp)