dev-cpp/safeint: new package, add 3.0.28a

Signed-off-by: Pavel Sobolev <contact@paveloom.dev>
This commit is contained in:
Pavel Sobolev
2025-08-14 12:36:04 +03:00
parent 65173da4b5
commit 341dfd553c
6 changed files with 137 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
From: Pavel Sobolev <contact@paveloom.dev>
Subject: [PATCH] Install the library.
Bug: https://github.com/dcleblanc/SafeInt/issues/67
Signed-off-by: Pavel Sobolev <contact@paveloom.dev>
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,4 +26,14 @@ add_subdirectory(Test/ClangTest)
add_subdirectory(Test/GccTest)
add_subdirectory(Test/MsvcTest)
-enable_testing()
\ No newline at end of file
+enable_testing()
+
+add_library(SafeInt INTERFACE)
+target_include_directories(SafeInt INTERFACE .)
+
+include(GNUInstallDirs)
+install(
+ FILES SafeInt.hpp safe_math.h safe_math_impl.h
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
+)
+install(FILES LICENSE DESTINATION "${CMAKE_INSTALL_DOCDIR}")

View File

@@ -0,0 +1,25 @@
From: Pavel Sobolev <contact@paveloom.dev>
Subject: [PATCH] Make tests optional.
Signed-off-by: Pavel Sobolev <contact@paveloom.dev>
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,11 +22,13 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
# - Intel (not regularly tested)
# other compilers on a best effort
-add_subdirectory(Test/ClangTest)
-add_subdirectory(Test/GccTest)
-add_subdirectory(Test/MsvcTest)
+include(CTest)
-enable_testing()
+if (BUILD_TESTING)
+ add_subdirectory(Test/ClangTest)
+ add_subdirectory(Test/GccTest)
+ add_subdirectory(Test/MsvcTest)
+endif()
add_library(SafeInt INTERFACE)
target_include_directories(SafeInt INTERFACE .)

View File

@@ -0,0 +1,41 @@
From: Pavel Sobolev <contact@paveloom.dev>
Subject: [PATCH] Remove broken tests.
Bug: https://github.com/dcleblanc/SafeInt/issues/55
Signed-off-by: Pavel Sobolev <contact@paveloom.dev>
--- a/Test/GccTest/CMakeLists.txt
+++ b/Test/GccTest/CMakeLists.txt
@@ -105,15 +105,6 @@ else()
target_compile_options(CompileTest_gcc PUBLIC -Wall)
- add_executable(CompileTest_gcc17
- ../CompileTest.cpp
- ../ConstExpr.cpp
- ../CleanCompile.cpp
- ../../SafeInt.hpp
- )
-
- target_compile_options(CompileTest_gcc17 PUBLIC -Wall -std=c++17)
-
add_executable(CompileTest_gcc14
../CompileTest.cpp
../ConstExpr.cpp
@@ -132,15 +123,6 @@ else()
target_compile_options(CompileTest_gcc14_NoEH PUBLIC -Wall -std=c++14 -fno-exceptions)
- add_executable(CompileTest_gcc98
- ../CompileTest.cpp
- ../ConstExpr.cpp
- ../CleanCompile.cpp
- ../../SafeInt.hpp
- )
-
- target_compile_options(CompileTest_gcc98 PUBLIC -D SAFEINT_USE_CPLUSCPLUS_98 -Wall -std=c++98 -fno-exceptions)
-
add_executable(safe_math_test_gcc
../c_safe_math/safe_math_test.c
../c_safe_math/safe_math_test.h