Skip to content

Commit 253f795

Browse files
Added logging library
1 parent 29c9eeb commit 253f795

File tree

6 files changed

+27
-6
lines changed

6 files changed

+27
-6
lines changed

CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ endif ()
2828
##############################################
2929
option(OPTION_EXTRA_CONFIG_INFO "Print useful cmake debug info while configuring" OFF)
3030

31+
if (MINGW)
32+
message("ERROR: Due to the requirements of the project, mingw builds are currently disabled. Native windows builds should still work.")
33+
return()
34+
endif ()
3135
#############################################
3236
#
3337
# Build 64bit binaries on Mac and target Macos 10.7 or later
@@ -144,6 +148,16 @@ endif(WIN32)
144148
#############################################
145149
# installation directories
146150
#############################################
151+
# You can install spdlog with the following:
152+
# > Debian: sudo apt install libspdlog-dev
153+
# > Homebrew: brew install spdlog
154+
# > Conan: conan install --requires=spdlog/[*] ( it may be easier just to add to the conan file!)
155+
# > vcpkg: vcpkg install spdlog
156+
if(NOT TARGET spdlog)
157+
# Stand-alone build
158+
find_package(spdlog REQUIRED)
159+
endif()
160+
147161
if (NOT OPTION_TARGET_MESSAGING)
148162
set(OPTION_EXE_DIRECTORY "bin" CACHE PATH "installation directory")
149163
else (NOT OPTION_TARGET_MESSAGING)

Dockerfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@ FROM debian:trixie-slim AS build
22
SHELL ["/bin/bash", "-c"]
33

44
RUN apt-get -y update && apt-get install -y apt-utils && apt-get remove --purge gcc
5-
RUN apt-get install -y -qq -o=Dpkg::Use-Pty=0 mold ninja-build cmake clang-19 clang++-19 clang-tools-19 libc++-19-dev libc++abi-19-dev \
6-
libcurl4-openssl-dev git curl wget ca-certificates python3 python3-pip
5+
# line 1 => build dependencies
6+
# line 2 => build tools
7+
# line 3 => dependencies
8+
RUN apt-get install -y -qq -o=Dpkg::Use-Pty=0 \
9+
git curl wget ca-certificates python3 python3-pip \
10+
mold ninja-build cmake clang-19 clang++-19 clang-tools-19 libc++-19-dev libc++abi-19-dev \
11+
libspdlog-dev libcurl4-openssl-dev
12+
713
RUN rm $(which gcc) || true
814
RUN rm $(which g++) || true
915
RUN rm -rf /var/lib/apt/lists/* && rm /usr/bin/ld
10-
#RUN ln -s $(which clang-18) /usr/bin/clang
11-
#RUN ln -s $(which clang++-18) /usr/bin/clang++
1216
RUN ln -s $(which mold) /usr/bin/ld
1317
RUN clang-19 --version
1418
RUN ln -s $(which clang-19) /usr/bin/clang

IDAWin/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ set (EXE_SRC_FILES
2929
)
3030

3131
add_library(IDAWin STATIC ${SRC_FILES} ${HEADER_FILES})
32-
target_link_libraries(IDAWin sundials ExpressionParser vcellmessaging argparse)
32+
target_link_libraries(IDAWin sundials ExpressionParser vcellmessaging argparse spdlog::spdlog) # if MinGW is enabled, add `$<$<BOOL:${MINGW}>:ws2_32>`
3333
set(EXE_FILE SundialsSolverStandalone)
3434
if (ARCH_64bit)
3535
set(EXE_FILE ${EXE_FILE}_x64)

VCellMessaging/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if (OPTION_TARGET_MESSAGING)
3333
message(STATUS "CURL_INCLUDE_DIR = '${CURL_INCLUDE_DIR}'")
3434
endif ()
3535

36-
target_link_libraries(vcellmessaging ${CURL_LIBRARIES} Threads::Threads)
36+
target_link_libraries(vcellmessaging ${CURL_LIBRARIES} Threads::Threads spdlog::spdlog) # if MinGW is enabled, add `$<$<BOOL:${MINGW}>:ws2_32>`
3737
target_compile_definitions(vcellmessaging PUBLIC USE_MESSAGING=1)
3838
target_include_directories(vcellmessaging PUBLIC ${CURL_INCLUDE_DIR})
3939
endif()

conanfile.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def build(self):
3131

3232
def requirements(self):
3333
self.requires("argparse/[>=3.2 <4.0]")
34+
self.requires("spdlog/[>=1.16.0 <2.0]")
3435
if self.options.include_messaging:
3536
self.requires("libcurl/[<9.0]")
3637

tests/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ add_executable(unit_tests
2424
target_link_libraries(unit_tests PRIVATE
2525
IDAWin
2626
GTest::gtest_main
27+
spdlog::spdlog
28+
# if MinGW is enabled, add `$<$<BOOL:${MINGW}>:ws2_32>`
2729
)
2830
gtest_discover_tests(unit_tests)
2931

0 commit comments

Comments
 (0)