Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support FreeBSD #194

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ add_executable(

add_definitions(-std=c99 -O3)

if(CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
find_package(OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIR})

# 600 - X/Open 6, incorporating POSIX 2004
# This is for fix sqlite3 error: use of undeclared identifier 'fchmod'
add_definitions("-D_XOPEN_SOURCE=600")
endif()

add_subdirectory(deps/glfw)
include_directories(deps/glew/include)
include_directories(deps/glfw/include)
Expand All @@ -25,25 +34,30 @@ include_directories(deps/tinycthread)

if(MINGW)
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH}
"C:/Program Files/CURL/lib" "C:/Program Files (x86)/CURL/lib")
"C:/Program Files/CURL/lib" "C:/Program Files (x86)/CURL/lib")
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH}
"C:/Program Files/CURL/include" "C:/Program Files (x86)/CURL/include")
"C:/Program Files/CURL/include" "C:/Program Files (x86)/CURL/include")
endif()

find_package(CURL REQUIRED)
include_directories(${CURL_INCLUDE_DIR})

if(APPLE)
target_link_libraries(craft glfw
${GLFW_LIBRARIES} ${CURL_LIBRARIES})
${GLFW_LIBRARIES} ${CURL_LIBRARIES})
endif()

if(CMAKE_SYSTEM_NAME STREQUAL Linux)
target_link_libraries(craft dl glfw
${GLFW_LIBRARIES} ${CURL_LIBRARIES})
endif()

if(UNIX)
target_link_libraries(craft dl glfw
${GLFW_LIBRARIES} ${CURL_LIBRARIES})
if(CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
target_link_libraries(craft glfw
${GLFW_LIBRARIES} ${CURL_LIBRARIES})
endif()

if(MINGW)
target_link_libraries(craft ws2_32.lib glfw
${GLFW_LIBRARIES} ${CURL_LIBRARIES})
${GLFW_LIBRARIES} ${CURL_LIBRARIES})
endif()
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ See below to run from source.

### Install Dependencies

#### FreeBSD

Download and install [CMake](http://www.cmake.org/cmake/resources/software.html)

pkg install cmake curl

#### Mac OS X

Download and install [CMake](http://www.cmake.org/cmake/resources/software.html)
Expand Down
2 changes: 2 additions & 0 deletions src/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#else
#include <netdb.h>
#include <unistd.h>
#include <netinet/in.h>
#include <sys/socket.h>
#endif

#include <stdio.h>
Expand Down