Skip to content

Commit

Permalink
Update build config
Browse files Browse the repository at this point in the history
  • Loading branch information
ltrzesniewski committed Dec 27, 2024
1 parent 84b1cc4 commit a6f950f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
project(PCRE.NET.Native C)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED TRUE)
set(CMAKE_C_VISIBILITY_PRESET hidden)

set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_SKIP_INSTALL_RULES true)

if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION true)
endif()

if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Wl,--no-undefined")
endif()

Expand Down
22 changes: 20 additions & 2 deletions src/PCRE.NET.Native/pcre2config.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
/* ReSharper disable All */

#define HAVE_ASSERT_H 1
#define HAVE_BUILTIN_ASSUME
#define HAVE_INTTYPES_H 1
#define HAVE_LIMITS_H 1
#define HAVE_MEMMOVE 1
Expand All @@ -17,7 +16,6 @@
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_WCHAR_H 1
#define HAVE_WINDOWS_H 1

#define NEWLINE_DEFAULT 5

Expand All @@ -26,4 +24,24 @@
#define SUPPORT_JIT 1
#define SUPPORT_UNICODE 1

#if _MSC_VER

#define HAVE_BUILTIN_ASSUME
#define HAVE_WINDOWS_H 1
#define _CRT_SECURE_NO_WARNINGS

#elif __GNUC__

#define HAVE_BUILTIN_MUL_OVERFLOW
#define HAVE_BUILTIN_UNREACHABLE

#elif __clang__

#define HAVE_ATTRIBUTE_UNINITIALIZED
#define HAVE_BUILTIN_UNREACHABLE

#else

#error "Unexpected compiler"

#endif

0 comments on commit a6f950f

Please sign in to comment.