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