← Back to team overview

kicad-developers team mailing list archive

Improve GLM check to ignore clang (which is working)

 

Hi,

at the moment I revert the "Check for incompatible glm version" every
time I update the KiCad sources, because I'm using clang instead which
is working with the current glm version on arch linux.

My Patch binds the GLM check to GCC only, to allow other compilers to
work with newer GLM versions.

Regards,

Thomas
From 59fd03a63949d16b67c789038f681abbd9e67dfb Mon Sep 17 00:00:00 2001
From: Thomas Pointhuber <thomas.pointhuber@xxxxxx>
Date: Sun, 6 Jan 2019 11:55:15 +0100
Subject: [PATCH] Fix check for incompatible glm version in cmake

Build fails on GCC, but not with Clang. Modify the check to only catch the
cases where GLM does not work for sure.

Reference: lp:1804030
* https://bugs.launchpad.net/kicad/+bug/1804030
---
 CMakeLists.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a7b8f166a..6c907176e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -587,9 +587,9 @@ endif()
 # Find GLM library, required
 #
 find_package( GLM 0.9.5.1 REQUIRED )
-if( GLM_VERSION MATCHES "0.9.9.3" )
-    MESSAGE( FATAL_ERROR "\nGLM version ${GLM_VERSION} is incompatible with KiCad.\n"
-                         "Please downgrade to GLM version 0.9.9.2 or older" )
+if( GLM_VERSION MATCHES "0.9.9.3" AND CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+    MESSAGE( FATAL_ERROR "\nGLM version ${GLM_VERSION} is incompatible with KiCad using GCC.\n"
+                         "Please downgrade to GLM version 0.9.9.2 or older or use clang instead" )
 endif()
 
 add_definitions( -DGLM_FORCE_CTOR_INIT )
-- 
2.20.1

Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups