@@ -95,26 +95,27 @@ else()
9595endif ()
9696
9797include (FetchContent)
98- set (ZIP_SRC thirdparty/zip/src)
99- set (UTFCPP_SRC thirdparty/utfcpp/source )
10098
101- add_library (zip SHARED
102- ${ZIP_SRC} /zip.c
103- ${ZIP_SRC} /zip.h
104- ${ZIP_SRC} /miniz.h
105- )
106- target_include_directories (scratchcpp PUBLIC ${ZIP_SRC} )
99+ # zip
100+ include (build /zip.cmake)
101+ target_link_libraries (scratchcpp PRIVATE zip)
107102
103+ # utfcpp
104+ set (UTFCPP_SRC thirdparty/utfcpp/source )
108105target_include_directories (scratchcpp PUBLIC ${UTFCPP_SRC} )
106+
107+ # spimpl
109108include_directories (thirdparty/spimpl)
110109
110+ # JSON
111111FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
112112FetchContent_MakeAvailable(json)
113-
114113target_link_libraries (scratchcpp PRIVATE nlohmann_json::nlohmann_json)
115- target_link_libraries (scratchcpp PRIVATE zip)
114+
115+ # Audio
116116target_link_libraries (scratchcpp PRIVATE scratchcpp-audio)
117117
118+ # Network
118119if (LIBSCRATCHCPP_NETWORK_SUPPORT)
119120 FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git
120121 GIT_TAG 225b7454877805f089b3895260438e929bd6d123) # 09-22-2024
@@ -123,18 +124,25 @@ if (LIBSCRATCHCPP_NETWORK_SUPPORT)
123124 target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_NETWORK_SUPPORT)
124125endif ()
125126
127+ # LLVM
126128if (LIBSCRATCHCPP_USE_LLVM)
127129 include (build /HunterPackages.cmake)
128130 include (build /LLVM.cmake)
129131 target_link_libraries (scratchcpp PRIVATE LLVM)
130132endif ()
131133
134+ if (LIBSCRATCHCPP_PRINT_LLVM_IR)
135+ target_compile_definitions (scratchcpp PRIVATE PRINT_LLVM_IR)
136+ endif ()
137+
138+ # Macros
132139target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_LIBRARY)
133140target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_VERSION="${PROJECT_VERSION} " )
134141target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} )
135142target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_VERSION_MINOR=${PROJECT_VERSION_MINOR} )
136143target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_VERSION_PATCH=${PROJECT_VERSION_PATCH} )
137144
145+ # Unit tests
138146if (LIBSCRATCHCPP_BUILD_UNIT_TESTS)
139147 enable_testing ()
140148 add_subdirectory (test )
0 commit comments