Skip to content

Commit

Permalink
build: install jalog, ref #180
Browse files Browse the repository at this point in the history
  • Loading branch information
iboB committed Nov 5, 2024
1 parent 5c3ce01 commit 56a4b6e
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 33 deletions.
3 changes: 3 additions & 0 deletions common/astl/public/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ add_library(astl-public INTERFACE)
add_library(ac::astl-public ALIAS astl-public)
target_sources(astl-public INTERFACE FILE_SET HEADERS FILES
astl/symbol_export.h
astl/mem_streambuf.hpp
astl/safe_func.hpp
astl/small_vector.hpp
astl/time_t.hpp
astl/transparent_string_hash.hpp
astl/tsumap.hpp
astl/tuple_util.hpp
Expand Down
81 changes: 48 additions & 33 deletions common/jalog/code/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,68 @@
icm_add_lib(ac-jalog AC_JALOG)
add_library(ac::jalog ALIAS ac-jalog)

target_sources(ac-jalog PRIVATE
ac/jalog/API.h
target_sources(ac-jalog
INTERFACE FILE_SET HEADERS FILES
ac/jalog/API.h

ac/jalog/Level.hpp
ac/jalog/ScopeDesc.hpp
ac/jalog/Entry.hpp
ac/jalog/Level.hpp
ac/jalog/ScopeDesc.hpp
ac/jalog/Entry.hpp

ac/jalog/Scope.hpp
ac/jalog/Scope.cpp
ac/jalog/Logger.hpp
ac/jalog/Logger.cpp
ac/jalog/Scope.hpp
ac/jalog/Logger.hpp
ac/jalog/Sink.hpp
ac/jalog/SinkPtr.hpp

ac/jalog/Sink.hpp
ac/jalog/Sink.cpp
ac/jalog/_qwrite.hpp

ac/jalog/_qwrite.hpp
ac/jalog/_qwrite.cpp
ac/jalog/BasicStream.hpp

ac/jalog/BasicStream.hpp
ac/jalog/Printf.hpp
ac/jalog/PrintfWrap.hpp

ac/jalog/Printf.hpp
ac/jalog/Printf.cpp
ac/jalog/PrintfWrap.hpp
ac/jalog/Log.hpp
ac/jalog/LogStream.hpp
ac/jalog/LogPrintf.hpp

ac/jalog/Log.hpp
ac/jalog/LogPrintf.hpp
ac/jalog/Instance.hpp

ac/jalog/Instance.hpp
ac/jalog/Instance.cpp
ac/jalog/sinks/AnsiColorSink.hpp
ac/jalog/sinks/SimpleOStreamSink.hpp
ac/jalog/sinks/SimpleStdioSink.hpp
PRIVATE

ac/jalog/Scope.cpp
ac/jalog/Logger.cpp
ac/jalog/Sink.cpp

ac/jalog/_qwrite.cpp

ac/jalog/Printf.cpp

ac/jalog/Instance.cpp

ac/jalog/sinks/AnsiColorSink.hpp
ac/jalog/sinks/AnsiColorSink.cpp
ac/jalog/sinks/AnsiColorSink.cpp
)

if(WIN32)
target_sources(ac-jalog PRIVATE
ac/jalog/sinks/WindowsColorSink.hpp
ac/jalog/sinks/WindowsColorSink.cpp
target_sources(ac-jalog
INTERFACE FILE_SET HEADERS FILES
ac/jalog/sinks/WindowsColorSink.hpp
PRIVATE ac/jalog/sinks/WindowsColorSink.cpp
)
elseif(ANDROID)
target_sources(ac-jalog PRIVATE
ac/jalog/sinks/AndroidSink.hpp
ac/jalog/sinks/AndroidSink.cpp
target_sources(ac-jalog
INTERFACE FILE_SET HEADERS FILES
ac/jalog/sinks/AndroidSink.hpp
PRIVATE ac/jalog/sinks/AndroidSink.cpp
)
target_link_libraries(ac-jalog PRIVATE log)
elseif(APPLE)
target_sources(ac-jalog PRIVATE
ac/jalog/sinks/NSLogSink.hpp
ac/jalog/sinks/NSLogSink.mm
target_sources(ac-jalog
INTERFACE FILE_SET HEADERS FILES
ac/jalog/sinks/NSLogSink.hpp
PRIVATE ac/jalog/sinks/NSLogSink.mm
)
find_library(COCOA Cocoa)
if(COCOA)
Expand All @@ -62,7 +75,6 @@ elseif(APPLE)
endif()
endif()

target_include_directories(ac-jalog INTERFACE .)
target_compile_definitions(ac-jalog PUBLIC -DAC_JALOG_NO_BUILTIN_ASYNC=1)
target_link_libraries(ac-jalog
PUBLIC
Expand All @@ -71,3 +83,6 @@ target_link_libraries(ac-jalog
itlib::itlib
)

install(TARGETS ac-jalog
FILE_SET HEADERS
)

0 comments on commit 56a4b6e

Please sign in to comment.