1
Fork 0
mirror of https://github.com/redstrate/Novus.git synced 2025-04-20 19:57:44 +00:00

Fix TickCount not picking up on OS properly at build-time

This commit is contained in:
Joshua Goins 2022-08-04 11:32:28 -04:00
parent ea4a056815
commit 7a4c5efbf3
2 changed files with 7 additions and 3 deletions

View file

@ -2,14 +2,14 @@ add_executable(argcracker src/main.cpp src/tickcount.cpp)
target_link_libraries(argcracker PUBLIC Qt5::Core ${LIBRARIES} physis z)
target_include_directories(argcracker PUBLIC include)
if(APPLE)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
target_compile_definitions(argcracker PUBLIC MACOS)
endif()
if(WIN32)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
target_compile_definitions(argcracker PUBLIC WIN32)
endif()
if(LINUX)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
target_compile_definitions(argcracker PUBLIC LINUX)
endif()

View file

@ -1,3 +1,5 @@
#include <cstdint>
#if defined(MACOS)
#include <sys/sysctl.h>
#include <mach/mach_time.h>
@ -22,6 +24,8 @@ uint32_t TickCount() {
#endif
#if defined(LINUX)
#include <ctime>
uint32_t TickCount() {
struct timespec ts;