forked from jpcima/ysfx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmake.deps.txt
98 lines (88 loc) · 3.24 KB
/
cmake.deps.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# -*- cmake -*-
# Copyright 2021 Jean Pierre Cimalando
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
include(GNUInstallDirs)
include(CheckCSourceCompiles)
find_package(Threads REQUIRED)
# nasm
# ------------------------------------------------------------------------------
find_program(NASM_PROGRAM "nasm")
# binutils
# ------------------------------------------------------------------------------
if(NOT APPLE AND NOT WIN32)
find_program(OBJCOPY_PROGRAM "objcopy")
find_program(RANLIB_PROGRAM "ranlib")
if(NOT OBJCOPY_PROGRAM)
message(WARNING "objcopy is missing, library cleanup will be skipped")
endif()
if(NOT RANLIB_PROGRAM)
message(WARNING "ranlib is missing, library cleanup will be skipped")
endif()
endif()
# Apple frameworks
# ------------------------------------------------------------------------------
if(APPLE)
function(ysfx_find_apple_framework NAME)
find_library("APPLE_${NAME}_FRAMEWORK" "${NAME}")
add_library("Apple_${NAME}" INTERFACE)
target_link_libraries("Apple_${NAME}" INTERFACE "${APPLE_${NAME}_FRAMEWORK}")
add_library("Apple::${NAME}" ALIAS "Apple_${NAME}")
endfunction()
ysfx_find_apple_framework(Cocoa)
ysfx_find_apple_framework(Carbon)
ysfx_find_apple_framework(Foundation)
ysfx_find_apple_framework(Metal)
endif()
# Graphics libraries
# ------------------------------------------------------------------------------
if(NOT WIN32 AND NOT APPLE)
find_package(Fontconfig)
find_package(Freetype)
if(NOT TARGET Freetype::Freetype)
message(WARNING "Freetype not found; fonts will not be supported")
elseif(NOT TARGET Fontconfig::Fontconfig)
message(WARNING "Fontconfig not found; font support will be limited")
endif()
endif()
# dr_libs
# ------------------------------------------------------------------------------
add_library(dr_libs INTERFACE)
target_include_directories(dr_libs INTERFACE "thirdparty/dr_libs")
# stb
# ------------------------------------------------------------------------------
add_library(stb INTERFACE)
target_include_directories(stb INTERFACE "thirdparty/stb")
# fts
# ------------------------------------------------------------------------------
if(WIN32)
set(YSFX_FTS_IS_AVAILABLE FALSE)
else()
check_c_source_compiles("
#include <fts.h>
int main() { fts_close((FTS *)0); return 0; }"
YSFX_FTS_IS_AVAILABLE)
endif()
if(YSFX_FTS_IS_AVAILABLE)
function(ysfx_check_fts_has_lfs_support VAR)
set(CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64")
check_c_source_compiles("
#include <fts.h>
int main() { fts_close((FTS *)0); return 0; }"
"${VAR}")
endfunction()
ysfx_check_fts_has_lfs_support(YSFX_FTS_HAS_LFS_SUPPORT)
endif()