Skip to content

Commit

Permalink
Update CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
Necas209 committed Apr 2, 2024
1 parent 01889ce commit 20b58c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ project(hanabi)
set(CMAKE_C_STANDARD 23)
set(CMAKE_C_STANDARD_REQUIRED ON)

# Link BSD library for arc4random (on BSD systems)
if (UNIX AND NOT APPLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -lbsd")
endif ()

add_executable(hanabi
src/lib/cJSON.h
src/lib/cJSON.c
Expand Down
8 changes: 0 additions & 8 deletions src/lib/lab.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,8 @@
#include <stdio.h>
#include <time.h>
#include <errno.h>

#if defined(__APPLE__) && defined(__MACH__)

#include <stdlib.h>

#endif
#if defined(__linux__)
#include <bsd/stdlib.h>
#endif

// Set the foreground and background color
__attribute__((unused)) void setColor(const ansi_color_t foreground, const ansi_bg_color_t background) {
printf("\033[%d;%dm", foreground, background);
Expand Down

0 comments on commit 20b58c7

Please sign in to comment.