|
Added
Link Here
|
| 1 |
--- CMakeLists.txt.orig 2025-12-19 16:57:53 UTC |
| 2 |
+++ CMakeLists.txt |
| 3 |
@@ -56,6 +56,10 @@ elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" ) |
| 4 |
|
| 5 |
# Linux: nothing to do here |
| 6 |
|
| 7 |
+elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL "NetBSD" ) |
| 8 |
+ |
| 9 |
+ # FreeBSD and NetBSD: nothing to do here |
| 10 |
+ |
| 11 |
elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" ) |
| 12 |
|
| 13 |
set_property ( GLOBAL PROPERTY FIND_LIBRARY_USE_OPENBSD_VERSIONING 1 ) |
| 14 |
@@ -423,7 +427,7 @@ if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) |
| 15 |
) |
| 16 |
endif () |
| 17 |
|
| 18 |
-elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" ) |
| 19 |
+elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES ".*BSD$" ) |
| 20 |
|
| 21 |
# create the application |
| 22 |
add_executable ( Einstein |
| 23 |
@@ -443,17 +447,22 @@ elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CM |
| 24 |
# how to compile and link |
| 25 |
target_compile_options ( Einstein PUBLIC |
| 26 |
-Wall -Wno-multichar -Wno-misleading-indentation -Wno-unused-result |
| 27 |
- -Wno-missing-field-initializers -Wno-stringop-truncation # -Werror |
| 28 |
+ -Wno-missing-field-initializers # -Werror |
| 29 |
# Werror is disabled for testing purposes. Must reenable as soon as all Linux warnings are fixed. |
| 30 |
) |
| 31 |
target_compile_options ( EinsteinTests PUBLIC |
| 32 |
-Wall -Wno-multichar -Wno-misleading-indentation -Wno-unused-result |
| 33 |
- -Wno-missing-field-initializers -Wno-stringop-truncation -Werror |
| 34 |
+ -Wno-missing-field-initializers -Werror |
| 35 |
) |
| 36 |
target_compile_options ( EinsteinFLGUI PUBLIC |
| 37 |
-Wall -Wno-multichar -Wno-misleading-indentation -Wno-unused-result |
| 38 |
- -Wno-missing-field-initializers -Wno-stringop-truncation -Werror |
| 39 |
+ -Wno-missing-field-initializers -Werror |
| 40 |
) |
| 41 |
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") |
| 42 |
+ target_compile_options(Einstein PUBLIC -Wno-stringop-truncation) |
| 43 |
+ target_compile_options(EinsteinTests PUBLIC -Wno-stringop-truncation) |
| 44 |
+ target_compile_options(EinsteinFLGUI PUBLIC -Wno-stringop-truncation) |
| 45 |
+ endif() |
| 46 |
target_compile_definitions ( Einstein PRIVATE |
| 47 |
TARGET_UI_FLTK=1 TARGET_OS_LINUX=1 |
| 48 |
) |
| 49 |
@@ -479,8 +488,8 @@ elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CM |
| 50 |
fltk::fltk fltk::images fltk::png fltk::z |
| 51 |
) |
| 52 |
|
| 53 |
- if ( ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" ) |
| 54 |
- # Under OpenBSD, libffi is in ports (i.e. /usr/local) not base (i.e. /usr) |
| 55 |
+ if ( ${CMAKE_SYSTEM_NAME} MATCHES ".*BSD$" ) |
| 56 |
+ # Under BSD, libffi is in ports (i.e. /usr/local) not base (i.e. /usr) |
| 57 |
find_library ( ffi_lib NAMES ffi ) |
| 58 |
find_file ( ffi_incl NAMES ffi.h ) |
| 59 |
if ( ffi_lib MATCHES ".*NOTFOUND" OR ffi_incl MATCHES ".*NOTFOUND" ) |
| 60 |
@@ -493,7 +502,7 @@ elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CM |
| 61 |
target_link_libraries ( Einstein ${ffi_lib} ) |
| 62 |
endif () |
| 63 |
|
| 64 |
- # Under OpenBSD, pulseaudio is in ports (i.e. /usr/local) not base (i.e. /usr) |
| 65 |
+ # Under BSD, pulseaudio is in ports (i.e. /usr/local) not base (i.e. /usr) |
| 66 |
find_library ( pulse_lib NAMES pulse ) |
| 67 |
if ( pulse_lib MATCHES ".*NOTFOUND" ) |
| 68 |
message ( FATAL_ERROR "libpulse not found! " ) |
| 69 |
@@ -503,7 +512,7 @@ elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CM |
| 70 |
target_link_libraries ( Einstein ${pulse_lib} ) |
| 71 |
endif () |
| 72 |
|
| 73 |
- # Under OpenBSD, X11 is in /usr/X11R6 |
| 74 |
+ # Under BSD, find X11 |
| 75 |
include ( FindX11 ) |
| 76 |
if ( X11_FOUND ) |
| 77 |
target_include_directories ( Einstein SYSTEM PUBLIC ${X11_INCLUDE_DIR} ) |
| 78 |
@@ -682,7 +691,7 @@ find_program(CLANG_FORMAT_EXECUTABLE |
| 79 |
# |
| 80 |
|
| 81 |
find_program(CLANG_FORMAT_EXECUTABLE |
| 82 |
- NAMES clang-format-14 clang-format-mp-14 clang-format |
| 83 |
+ NAMES clang-format-14 clang-format-mp-14 clang-format19 clang-format |
| 84 |
HINTS /usr/local/opt/clang-format@14/bin/ /usr/lib/llvm-14/bin/ |
| 85 |
DOC "clang-format executable") |
| 86 |
if(CLANG_FORMAT_EXECUTABLE) |