mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Merge 822f1fe178
into b4e25fe42f
This commit is contained in:
commit
1415e6303d
5 changed files with 60 additions and 20 deletions
|
@ -75,10 +75,17 @@ check_struct_has_member ("struct tm" tm_gmtoff time.h HAVE_TM_GMTOFF)
|
|||
check_struct_has_member ("struct stat" st_birthtime "sys/types.h;sys/stat.h" HAVE_ST_BIRTHTIME)
|
||||
|
||||
message ("-- Looking for libuuid")
|
||||
if (DARWIN OR FREEBSD OR OPENBSD)
|
||||
if (WINDOWS)
|
||||
# Windows has built-in UUID functionality via RPC API
|
||||
message ("-- Windows detected, using Windows UUID API")
|
||||
# Add the required Windows libraries for UUID support
|
||||
set (TASK_LIBRARIES ${TASK_LIBRARIES} rpcrt4)
|
||||
set (HAVE_UUID_UNPARSE_LOWER TRUE)
|
||||
# No need to add include dirs as Windows headers are already available
|
||||
elseif (DARWIN OR FREEBSD OR OPENBSD)
|
||||
# Apple and FreeBSD include the uuid functions in their libc, rather than libuuid
|
||||
check_function_exists (uuid_unparse_lower HAVE_UUID_UNPARSE_LOWER)
|
||||
else (DARWIN OR FREEBSD OR OPENBSD)
|
||||
else (WINDOWS)
|
||||
find_path (UUID_INCLUDE_DIR uuid/uuid.h)
|
||||
find_library (UUID_LIBRARY NAMES uuid)
|
||||
if (UUID_INCLUDE_DIR AND UUID_LIBRARY)
|
||||
|
@ -91,7 +98,7 @@ else (DARWIN OR FREEBSD OR OPENBSD)
|
|||
else (UUID_INCLUDE_DIR AND UUID_LIBRARY)
|
||||
message (FATAL_ERROR "-- libuuid not found.")
|
||||
endif (UUID_INCLUDE_DIR AND UUID_LIBRARY)
|
||||
endif (DARWIN OR FREEBSD OR OPENBSD)
|
||||
endif (WINDOWS)
|
||||
|
||||
if (HAVE_UUID_UNPARSE_LOWER)
|
||||
message ("-- Found libuuid")
|
||||
|
|
|
@ -3,6 +3,14 @@ message ("-- System: ${CMAKE_SYSTEM_NAME}")
|
|||
|
||||
include (CheckCXXCompilerFlag)
|
||||
|
||||
# Check for MSVC compiler to use the correct flag
|
||||
if(MSVC)
|
||||
set(_HAS_CXX17 ON) # MSVC 2019 supports C++17 by default
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
else()
|
||||
# For GCC, Clang, etc.
|
||||
CHECK_CXX_COMPILER_FLAG("-std=c++17" _HAS_CXX17)
|
||||
|
||||
if (_HAS_CXX17)
|
||||
|
@ -11,6 +19,7 @@ if (_HAS_CXX17)
|
|||
else (_HAS_CXX17)
|
||||
message (FATAL_ERROR "C++17 support missing. Try upgrading your C++ compiler. If you have a good reason for using an outdated compiler, please let us know at support@gothenburgbitfactory.org.")
|
||||
endif (_HAS_CXX17)
|
||||
endif()
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
set (LINUX true)
|
||||
|
@ -34,9 +43,15 @@ elseif (${CMAKE_SYSTEM_NAME} STREQUAL "GNU")
|
|||
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "CYGWIN")
|
||||
set (CYGWIN true)
|
||||
set (CMAKE_CXX_EXTENSIONS ON)
|
||||
else (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
set (WINDOWS true)
|
||||
# Add Windows-specific flags if needed
|
||||
else ()
|
||||
set (UNKNOWN true)
|
||||
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
endif ()
|
||||
|
||||
if(NOT MSVC)
|
||||
# These flags are not applicable to MSVC
|
||||
set (CMAKE_CXX_FLAGS "${_CXX14_FLAGS} ${CMAKE_CXX_FLAGS}")
|
||||
set (CMAKE_CXX_FLAGS "-Wall -Wextra -Wsign-compare -Wreturn-type ${CMAKE_CXX_FLAGS}")
|
||||
endif()
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 2aa844cb9b015fca81b947c57fde07999ede002b
|
||||
Subproject commit 1e949b4773df59be0ff6842600b49e265dfacefa
|
11
src/recur.h
11
src/recur.h
|
@ -36,11 +36,20 @@
|
|||
#include <Duration.h>
|
||||
#include <Lexer.h>
|
||||
#include <format.h>
|
||||
|
||||
// Platform-specific includes
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
// Windows-specific user info implementation will be needed
|
||||
// Create a pwd.h equivalent for Windows
|
||||
#else
|
||||
#include <pwd.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
#include <unicode.h>
|
||||
#include <unistd.h>
|
||||
#include <util.h>
|
||||
|
||||
#include <optional>
|
||||
|
|
17
src/util.h
17
src/util.h
|
@ -30,16 +30,25 @@
|
|||
#include <cmake.h>
|
||||
// cmake.h include header must come first
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#if defined(FREEBSD) || defined(OPENBSD)
|
||||
|
||||
// Platform-specific UUID handling
|
||||
#ifdef _WIN32
|
||||
#include <rpc.h>
|
||||
#include <windows.h>
|
||||
// Define uuid_t for Windows compatibility
|
||||
typedef UUID uuid_t;
|
||||
#ifndef uuid_unparse_lower
|
||||
void uuid_unparse_lower(uuid_t uu, char* out);
|
||||
#endif
|
||||
#elif defined(FREEBSD) || defined(OPENBSD)
|
||||
#include <sys/types.h>
|
||||
#include <uuid.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <uuid/uuid.h>
|
||||
#endif
|
||||
#include <Table.h>
|
||||
|
||||
// util.cpp
|
||||
int confirm4(const std::string&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue