Skip to content

Commit

Permalink
Linux: use the brute-force -pthread variant
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Dec 16, 2020
1 parent cbbeb61 commit e4014ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ endif()

# Linux -pthread shenanigans
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
endif()

#=== LIBRARY: cimgui + Dear ImGui
Expand Down Expand Up @@ -42,7 +43,6 @@ else()
add_library(sokol STATIC sokol/sokol.c ${SOKOL_HEADERS})
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
target_link_libraries(sokol INTERFACE X11 Xi Xcursor GL dl m)
target_link_libraries(sokol PUBLIC Threads::Threads)
endif()
endif()
target_link_libraries(sokol PUBLIC cimgui)
Expand Down

0 comments on commit e4014ba

Please sign in to comment.