@@ -14,6 +14,7 @@ add_library(scratchcpp SHARED)
14
14
add_subdirectory (src)
15
15
include_directories (src) # TODO: Remove this line
16
16
include_directories (include )
17
+ install (TARGETS scratchcpp DESTINATION lib)
17
18
18
19
target_sources (scratchcpp
19
20
PUBLIC
@@ -66,31 +67,28 @@ target_sources(scratchcpp
66
67
include /scratchcpp/test /scriptbuilder.h
67
68
)
68
69
69
- if (LIBSCRATCHCPP_PRINT_LLVM_IR)
70
- target_compile_definitions (scratchcpp PRIVATE PRINT_LLVM_IR)
71
- endif ()
72
-
73
70
include (FetchContent)
74
- set (ZIP_SRC thirdparty/zip/src)
75
- set (UTFCPP_SRC thirdparty/utfcpp/source )
76
71
77
- add_library (zip SHARED
78
- ${ZIP_SRC} /zip.c
79
- ${ZIP_SRC} /zip.h
80
- ${ZIP_SRC} /miniz.h
81
- )
82
- target_include_directories (scratchcpp PUBLIC ${ZIP_SRC} )
72
+ # zip
73
+ include (build /zip.cmake)
74
+ target_link_libraries (scratchcpp PRIVATE zip)
83
75
76
+ # utfcpp
77
+ set (UTFCPP_SRC thirdparty/utfcpp/source )
84
78
target_include_directories (scratchcpp PUBLIC ${UTFCPP_SRC} )
79
+
80
+ # spimpl
85
81
include_directories (thirdparty/spimpl)
86
82
83
+ # JSON
87
84
FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
88
85
FetchContent_MakeAvailable(json)
89
-
90
86
target_link_libraries (scratchcpp PRIVATE nlohmann_json::nlohmann_json)
91
- target_link_libraries (scratchcpp PRIVATE zip)
87
+
88
+ # Audio
92
89
target_link_libraries (scratchcpp PRIVATE scratchcpp-audio)
93
90
91
+ # Network
94
92
if (LIBSCRATCHCPP_NETWORK_SUPPORT)
95
93
FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git
96
94
GIT_TAG 225b7454877805f089b3895260438e929bd6d123) # 09-22-2024
@@ -99,16 +97,23 @@ if (LIBSCRATCHCPP_NETWORK_SUPPORT)
99
97
target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_NETWORK_SUPPORT)
100
98
endif ()
101
99
100
+ # LLVM
102
101
include (build /HunterPackages.cmake)
103
102
include (build /LLVM.cmake)
104
103
target_link_libraries (scratchcpp PRIVATE LLVM)
105
104
105
+ if (LIBSCRATCHCPP_PRINT_LLVM_IR)
106
+ target_compile_definitions (scratchcpp PRIVATE PRINT_LLVM_IR)
107
+ endif ()
108
+
109
+ # Macros
106
110
target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_LIBRARY)
107
111
target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_VERSION="${PROJECT_VERSION} " )
108
112
target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} )
109
113
target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_VERSION_MINOR=${PROJECT_VERSION_MINOR} )
110
114
target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_VERSION_PATCH=${PROJECT_VERSION_PATCH} )
111
115
116
+ # Unit tests
112
117
if (LIBSCRATCHCPP_BUILD_UNIT_TESTS)
113
118
enable_testing ()
114
119
add_subdirectory (test )
0 commit comments