-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
86 lines (63 loc) · 3.08 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
74
75
76
77
78
79
80
81
82
83
84
85
86
cmake_minimum_required(VERSION 3.21)
project(saucer-bindings LANGUAGES CXX VERSION 4.0.1)
# --------------------------------------------------------------------------------------------------------
# CMake options
# --------------------------------------------------------------------------------------------------------
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
# --------------------------------------------------------------------------------------------------------
# Create executable
# --------------------------------------------------------------------------------------------------------
add_library(${PROJECT_NAME} SHARED)
add_library(saucer::bindings ALIAS ${PROJECT_NAME})
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_23)
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 23 CXX_EXTENSIONS OFF CXX_STANDARD_REQUIRED ON)
if (PROJECT_IS_TOP_LEVEL AND NOT MSVC AND NOT CMAKE_CXX_SIMULATE_ID MATCHES "MSVC")
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic -Werror -pedantic -pedantic-errors -Wfatal-errors)
endif()
if (NOT MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-unknown-warning-option -Wno-missing-field-initializers -Wno-cast-function-type)
endif()
# --------------------------------------------------------------------------------------------------------
# Export header
# --------------------------------------------------------------------------------------------------------
include(GenerateExportHeader)
generate_export_header(
${PROJECT_NAME}
EXPORT_MACRO_NAME "SAUCER_EXPORT"
EXPORT_FILE_NAME "${CMAKE_CURRENT_SOURCE_DIR}/include/saucer/export.h"
)
# --------------------------------------------------------------------------------------------------------
# Include directories
# --------------------------------------------------------------------------------------------------------
target_include_directories(${PROJECT_NAME} PUBLIC "include")
target_include_directories(${PROJECT_NAME} PRIVATE "include/saucer" "private" "utils")
# --------------------------------------------------------------------------------------------------------
# Add Sources
# --------------------------------------------------------------------------------------------------------
target_sources(${PROJECT_NAME} PRIVATE
"src/app.cpp"
"src/desktop.cpp"
"src/string.cpp"
"src/memory.cpp"
"src/icon.cpp"
"src/stash.cpp"
"src/script.cpp"
"src/scheme.cpp"
"src/navigation.cpp"
"src/preferences.cpp"
"src/window.cpp"
"src/webview.cpp"
)
# --------------------------------------------------------------------------------------------------------
# Setup Dependencies
# --------------------------------------------------------------------------------------------------------
include("cmake/cpm.cmake")
CPMFindPackage(
NAME saucer
VERSION 4.2.0
GIT_REPOSITORY "https://github.com/saucer/saucer"
)
target_link_libraries(${PROJECT_NAME} PRIVATE saucer::saucer)