Skip to content

Commit eb316fc

Browse files
committed
misc: fix macos build
1 parent 34bcff8 commit eb316fc

3 files changed

Lines changed: 14 additions & 9 deletions

File tree

CMakeLists.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,23 @@ execute_process(COMMAND ./scripts/generateVersion.sh
4343
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
4444

4545
# https://github.com/libcpr/cpr/blob/5f475522597b8f3721e2440daddeced7a969f24c/CMakeLists.txt#L39
46-
macro(add_option OPTION_NAME OPTION_TEXT OPTION_DEFAULT)
46+
macro(add_option OPTION_NAME OPTION_TEXT OPTION_DEFAULT DEFINE_OPTION)
4747
option(${OPTION_NAME} ${OPTION_TEXT} ${OPTION_DEFAULT})
4848
if(DEFINED ENV{${OPTION_NAME}})
4949
# Allow overriding the option through an environment variable
5050
set(${OPTION_NAME} $ENV{${OPTION_NAME}})
5151
endif()
52-
if(${OPTION_NAME})
52+
if(${OPTION_NAME} AND DEFINE_OPTION)
5353
add_definitions(-D${OPTION_NAME})
5454
endif()
5555
message(STATUS " ${OPTION_NAME}: ${${OPTION_NAME}}")
5656
endmacro()
5757

5858
message(STATUS "Set flags:")
5959
message(STATUS "=================")
60-
add_option(GUI_APP "Build GTK3 application" 0)
61-
add_option(USE_DCONF "Compile customfetch with dconf support" 1)
62-
add_option(VARS "Add additional flags at CXXFLAGS" "")
60+
add_option(GUI_APP "Build GTK3 application" 0 1)
61+
add_option(USE_DCONF "Compile customfetch with dconf support" 1 0)
62+
add_option(VARS "Add additional flags at CXXFLAGS" "" 1)
6363
message(STATUS "=================")
6464

6565
if(GUI_APP)
@@ -135,6 +135,8 @@ add_library(cufetch SHARED
135135
libcufetch/config.cc
136136
libcufetch/cufetch.cc
137137
libcufetch/parse.cc
138+
src/libs/toml++/toml.cpp
139+
src/util.cpp
138140
)
139141

140142
set_target_properties(cufetch PROPERTIES
@@ -144,6 +146,7 @@ set_target_properties(cufetch PROPERTIES
144146
POSITION_INDEPENDENT_CODE ON
145147
)
146148

149+
target_link_libraries(cufetch PUBLIC tiny-process-library)
147150
target_link_libraries(cufetch PUBLIC fmt)
148151
target_link_libraries(${TARGET_NAME} PUBLIC cufetch)
149152

include/texts.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ Tag References:
176176
177177
3. Conditional Tag ($[])
178178
Displays different outputs based on conditions.
179-
179+
180180
Syntax: $[condition,comparison,true_output,false_output]
181-
181+
182182
Examples:
183183
- $[$<user.name>,toni,Welcome back!,Access denied]
184184
- $[$(date +%m-%d),12-25,Merry Christmas!,]
@@ -271,7 +271,9 @@ layout = [
271271
"${auto}OS: $<os.name> $<system.arch>",
272272
"${auto}Host: $<system.host>",
273273
"${auto}Kernel: $<os.kernel>",
274-
"${auto}Uptime: $<os.uptime>",)#"
274+
"${auto}Uptime: $<os.uptime>",
275+
"${auto}Terminal: $<user.terminal>",
276+
"${auto}Shell: $<user.shell>",)#"
275277
#if !CF_ANDROID
276278
R"#(
277279
"${auto}Theme: $<theme.gtk.all.name>",

src/core-modules/macos/system.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ const std::string get_host_from_family(const std::string_view host_family)
152152
}
153153
else if (hasStart(host_family, "MacPro"))
154154
{
155-
const std::string_view version = host_family.substr("MacPro"_leMac Pro(2019) n);
155+
const std::string_view version = host_family.substr("MacPro"_len);
156156
switch (fnv1a16::hash(version.data()))
157157
{
158158
case "7,1"_fnv1a16: return "Mac Pro (2019)";

0 commit comments

Comments
 (0)