Skip to content

Commit

Permalink
Use system pthread
Browse files Browse the repository at this point in the history
  • Loading branch information
doegox committed Oct 17, 2023
1 parent 6e19d07 commit adfb440
Show file tree
Hide file tree
Showing 36 changed files with 5 additions and 14,828 deletions.
15 changes: 4 additions & 11 deletions software/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,36 +35,29 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux")

add_compile_options(-D_GNU_SOURCE)

find_package(Threads)
elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
MESSAGE(STATUS "Run on Windows.")

# Add pthread header for Windows
include_directories(lib/pthread/include)

# optimize
if (CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Ox")
endif()

# pthread need
add_definitions(-DHAVE_STRUCT_TIMESPEC)

# find the pthread dep
find_library(LIBTHREAD pthreadVC2.lib lib/pthread/lib/x64/)
else()
MESSAGE(STATUS "other platform: ${CMAKE_SYSTEM_NAME}")
endif()

find_package(Threads)

# ignore warning C4996
add_compile_options(-D_CRT_SECURE_NO_WARNINGS)

# tools
add_executable(nested ${COMMON_FILES} ${NESTED_UTIL} nested.c)
target_link_libraries(nested ${LIBTHREAD})
target_link_libraries(nested PRIVATE pthread)

add_executable(staticnested ${COMMON_FILES} ${NESTED_UTIL} staticnested.c)
target_link_libraries(staticnested ${LIBTHREAD})
target_link_libraries(staticnested PRIVATE pthread)

add_executable(darkside ${COMMON_FILES} ${MFKEY_UTIL} darkside.c)

Expand Down
Loading

0 comments on commit adfb440

Please sign in to comment.