diff --git a/cad/kicad/files/patch-CMakeLists.txt b/cad/kicad/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..555276a0bd83 --- /dev/null +++ b/cad/kicad/files/patch-CMakeLists.txt @@ -0,0 +1,40 @@ +commit 46a59aa2c3e23aa5dd5243e697eb29f8da680e03 +Author: Christoph Moench-Tegeder +Date: Tue Feb 21 20:45:27 2023 +0100 + + CMakeLists.txt: do not use -ffloat-store on clang + + According to it's User Manual, clang does not know about -ffloat-store. + This is corrobated by the FreeBSD i386 build (using LLVM 13 and 15, + depending on the base system version) failing early with an error + message complaining about this parameter being unknown. + + See + https://pkg-status.freebsd.org/beefy17/data/main-i386-default/pb27279cba1ca_sed03776ca7/logs/kicad-7.0.0,2.log + for an example of the failure, and + https://clang.llvm.org/docs/UsersManual.html#controlling-floating-point-behavior + for the available floating point options on clang. + +diff --git CMakeLists.txt CMakeLists.txt +index 47dff66be0..20239b4f09 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -365,12 +365,16 @@ endif(USE_DISTCC) + # Set flags for GCC, or treat llvm as GCC + #================================================ + +-if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) +- ++if( CMAKE_COMPILER_IS_GNUCXX ) + # Set 32-bit flag for GCC to prevent excess precision ++ # clang des not know this flag, so keep this separate + if( CMAKE_SIZEOF_VOID_P EQUAL 4 ) + set( CMAKE_CXX_FLAGS "-ffloat-store ${CMAKE_CXX_FLAGS}" ) + endif() ++endif( CMAKE_COMPILER_IS_GNUCXX ) ++ ++ ++if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) + + # Link flags in Debug: -g1 and -ggdb1 or -g1 and -ggdb3 can be used. + # Level 1 produces minimal information, enough for making basic backtraces.