Skip to content

Commit

Permalink
【FreeBSD】Patch from Quist to fix FreeBSD build
Browse files Browse the repository at this point in the history
  • Loading branch information
skylersaleh committed Aug 10, 2023
1 parent 73c81ef commit 540c228
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ if (CMAKE_SYSTEM_NAME STREQUAL Linux)
endif()
if (UNIX AND NOT APPLE AND NOT PLATFORM_LINUX)
set(PLATFORM_FREEBSD TRUE)
find_package(ALSA REQUIRED)
link_directories(/usr/local/lib)
endif()

if (UNIX AND NOT APPLE AND NOT ANDROID)
find_package(X11 REQUIRED)
endif()
# TinyFileDialogs
if ((NOT IOS) AND (NOT EMSCRIPTEN) AND (NOT ANDROID) AND (NOT PLATFORM_LINUX) AND (NOT PLATFORM_FREEBSD))
Expand Down Expand Up @@ -188,8 +194,12 @@ if(MACOS OR IOS)
else()
add_library(sokol STATIC src/sokol/sokol.c ${SOKOL_HEADERS})
set_property(TARGET sokol PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded")
if (UNIX AND NOT APPLE AND NOT ANDROID)
target_include_directories(sokol PRIVATE "${X11_INCLUDE_DIR}")
target_link_libraries(sokol INTERFACE ${X11_X11_LIB} ${X11_Xi_LIB} ${X11_Xcursor_LIB} OpenGL::OpenGL dl)
endif()
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
target_link_libraries(sokol INTERFACE X11 Xi Xcursor GL dl m)
target_link_libraries(sokol INTERFACE m)
target_link_libraries(sokol PUBLIC Threads::Threads)
endif()
endif()
Expand Down

0 comments on commit 540c228

Please sign in to comment.