@@ -66,31 +66,28 @@ target_sources(scratchcpp
6666 include /scratchcpp/test/scriptbuilder.h
6767)
6868
69- if (LIBSCRATCHCPP_PRINT_LLVM_IR)
70- target_compile_definitions (scratchcpp PRIVATE PRINT_LLVM_IR )
71- endif ()
72-
7369include (FetchContent )
74- set (ZIP_SRC thirdparty/zip/src)
75- set (UTFCPP_SRC thirdparty/utfcpp/source)
7670
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 )
8374
75+ # utfcpp
76+ set (UTFCPP_SRC thirdparty/utfcpp/source)
8477target_include_directories (scratchcpp PUBLIC ${UTFCPP_SRC} )
78+
79+ # spimpl
8580include_directories (thirdparty/spimpl )
8681
82+ # JSON
8783FetchContent_Declare (json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
8884FetchContent_MakeAvailable (json)
89-
9085target_link_libraries (scratchcpp PRIVATE nlohmann_json::nlohmann_json )
91- target_link_libraries (scratchcpp PRIVATE zip )
86+
87+ # Audio
9288target_link_libraries (scratchcpp PRIVATE scratchcpp-audio )
9389
90+ # Network
9491if (LIBSCRATCHCPP_NETWORK_SUPPORT)
9592 FetchContent_Declare (cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git
9693 GIT_TAG 225b7454877805f089b3895260438e929bd6d123) # 09-22-2024
@@ -99,16 +96,23 @@ if (LIBSCRATCHCPP_NETWORK_SUPPORT)
9996 target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_NETWORK_SUPPORT )
10097endif ()
10198
99+ # LLVM
102100include (build /HunterPackages.cmake )
103101include (build /LLVM.cmake )
104102target_link_libraries (scratchcpp PRIVATE LLVM )
105103
104+ if (LIBSCRATCHCPP_PRINT_LLVM_IR)
105+ target_compile_definitions (scratchcpp PRIVATE PRINT_LLVM_IR )
106+ endif ()
107+
108+ # Macros
106109target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_LIBRARY )
107110target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_VERSION= "${PROJECT_VERSION} " )
108111target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} )
109112target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_VERSION_MINOR=${PROJECT_VERSION_MINOR} )
110113target_compile_definitions (scratchcpp PRIVATE LIBSCRATCHCPP_VERSION_PATCH=${PROJECT_VERSION_PATCH} )
111114
115+ # Unit tests
112116if (LIBSCRATCHCPP_BUILD_UNIT_TESTS)
113117 enable_testing ()
114118 add_subdirectory (test )
0 commit comments