| 1 |
diff --git a/CMakeLists.txt b/CMakeLists.txt |
| 2 |
index 9cd1b4b..3912b26 100644 |
| 3 |
--- a/CMakeLists.txt |
| 4 |
+++ b/CMakeLists.txt |
| 5 |
@@ -1,4 +1,4 @@ |
| 6 |
-cmake_minimum_required(VERSION 2.8) |
| 7 |
+cmake_minimum_required(VERSION 3.22) |
| 8 |
project(GKlib C) |
| 9 |
|
| 10 |
option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" OFF) |
| 11 |
@@ -22,10 +22,11 @@ if(UNIX) |
| 12 |
target_link_libraries(GKlib m) |
| 13 |
endif(UNIX) |
| 14 |
|
| 15 |
-include_directories("test") |
| 16 |
-add_subdirectory("test") |
| 17 |
|
| 18 |
install(TARGETS GKlib |
| 19 |
- ARCHIVE DESTINATION lib/${LINSTALL_PATH} |
| 20 |
- LIBRARY DESTINATION lib/${LINSTALL_PATH}) |
| 21 |
+ EXPORT GKlibTargets |
| 22 |
+ INCLUDES DESTINATION "include/GKlib" |
| 23 |
+) |
| 24 |
+install(EXPORT GKlibTargets FILE "GKlibConfig.cmake" DESTINATION "share/gklib") |
| 25 |
+install(FILES "win32/adapt.h" DESTINATION "include/${HINSTALL_PATH}/win32") |
| 26 |
install(FILES ${GKlib_includes} DESTINATION include/${HINSTALL_PATH}) |
| 27 |
diff --git a/GKlibSystem.cmake b/GKlibSystem.cmake |
| 28 |
index 31a1cf1..172a386 100644 |
| 29 |
--- a/GKlibSystem.cmake |
| 30 |
+++ b/GKlibSystem.cmake |
| 31 |
@@ -18,7 +18,6 @@ option(NO_X86 "enable NO_X86 support" OFF) |
| 32 |
|
| 33 |
# Add compiler flags. |
| 34 |
if(MSVC) |
| 35 |
- set(GKlib_COPTS "/Ox") |
| 36 |
set(GKlib_COPTIONS "-DWIN32 -DMSC -D_CRT_SECURE_NO_DEPRECATE -DUSE_GKREGEX") |
| 37 |
elseif(MINGW) |
| 38 |
set(GKlib_COPTS "-DUSE_GKREGEX") |
| 39 |
@@ -33,6 +32,8 @@ if(CMAKE_COMPILER_IS_GNUCC) |
| 40 |
set(GKlib_COPTIONS "${GKlib_COPTIONS} -std=c99 -fno-strict-aliasing") |
| 41 |
if(VALGRIND) |
| 42 |
set(GKlib_COPTIONS "${GK_COPTIONS} -march=x86-64 -mtune=generic") |
| 43 |
+elseif(1) |
| 44 |
+ # Use flags from toolchain and triplet |
| 45 |
else() |
| 46 |
# -march=native is not a valid flag on PPC: |
| 47 |
if(CMAKE_SYSTEM_PROCESSOR MATCHES "power|ppc|powerpc|ppc64|powerpc64" OR (APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc|ppc64")) |
| 48 |
@@ -46,6 +47,7 @@ endif(VALGRIND) |
| 49 |
endif(NOT MINGW) |
| 50 |
# GCC warnings. |
| 51 |
set(GKlib_COPTIONS "${GKlib_COPTIONS} -Werror -Wall -pedantic -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -Wno-unused-label") |
| 52 |
+ string(REPLACE " -Werror " " " GKlib_COPTIONS "${GKlib_COPTIONS}") |
| 53 |
elseif(${CMAKE_C_COMPILER_ID} MATCHES "Sun") |
| 54 |
# Sun insists on -xc99. |
| 55 |
set(GKlib_COPTIONS "${GKlib_COPTIONS} -xc99") |
| 56 |
@@ -75,6 +77,8 @@ endif(NO_X86) |
| 57 |
if(GDB) |
| 58 |
set(GKlib_COPTS "${GKlib_COPTS} -g") |
| 59 |
set(GKlib_COPTIONS "${GKlib_COPTIONS} -Werror") |
| 60 |
+elseif(1) |
| 61 |
+ # Use flags from toolchain and triplet |
| 62 |
else() |
| 63 |
set(GKlib_COPTS "-O3") |
| 64 |
endif(GDB) |
| 65 |
diff --git a/gk_ms_inttypes.h b/gk_ms_inttypes.h |
| 66 |
index b89fc10..7247c38 100644 |
| 67 |
--- a/gk_ms_inttypes.h |
| 68 |
+++ b/gk_ms_inttypes.h |
| 69 |
@@ -35,6 +35,8 @@ |
| 70 |
|
| 71 |
#ifndef _MSC_INTTYPES_H_ // [ |
| 72 |
#define _MSC_INTTYPES_H_ |
| 73 |
+#include <inttypes.h> |
| 74 |
+#elif 0 |
| 75 |
|
| 76 |
#if _MSC_VER > 1000 |
| 77 |
#pragma once |
| 78 |
diff --git a/gk_ms_stdint.h b/gk_ms_stdint.h |
| 79 |
index 7e200dc..1c51958 100644 |
| 80 |
--- a/gk_ms_stdint.h |
| 81 |
+++ b/gk_ms_stdint.h |
| 82 |
@@ -35,6 +35,8 @@ |
| 83 |
|
| 84 |
#ifndef _MSC_STDINT_H_ // [ |
| 85 |
#define _MSC_STDINT_H_ |
| 86 |
+#include <stdint.h> |
| 87 |
+#elif 0 |
| 88 |
|
| 89 |
#if _MSC_VER > 1000 |
| 90 |
#pragma once |