-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
73 lines (64 loc) · 1.79 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#===============================================================================
#
# CMakeLists.txt for compiling agbabi
#
# Copyright (C) 2021-2023 agbabi contributors
# For conditions of distribution and use, see copyright notice in LICENSE.md
#
#===============================================================================
cmake_minimum_required(VERSION 3.18)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
# Default to Release build type
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
project(agbabi LANGUAGES ASM C VERSION 2.1.6)
add_library(agbabi STATIC
source/atan2.c
source/context.c
source/coroutine.c
source/ewram.c
source/multiboot.c
source/rtc.c
source/context.s
source/coroutine.s
source/fiq_memcpy.s
source/idiv.s
source/irq.s
source/ldiv.s
source/lmul.s
source/memcpy.s
source/memmove.s
source/memset.s
source/rmemcpy.s
source/sine.s
source/sqrt.s
source/uidiv.s
source/uldiv.s
source/uluidiv.s
)
set_source_files_properties(source/atan2.c PROPERTIES COMPILE_FLAGS "-marm")
target_compile_features(agbabi PRIVATE c_std_11)
target_include_directories(agbabi PUBLIC include)
target_compile_options(agbabi PRIVATE
-masm-syntax-unified
$<$<COMPILE_LANGUAGE:ASM>:
"-Wa,-I${CMAKE_CURRENT_LIST_DIR}/source"
>
$<$<COMPILE_LANGUAGE:C>: -mthumb
-fomit-frame-pointer
-ffunction-sections
-fdata-sections
-Wall
-Wextra
-Wpedantic
-Wconversion
-Wstrict-prototypes
>
)
install(TARGETS agbabi
LIBRARY DESTINATION lib
)
install(DIRECTORY include/
DESTINATION include
)