Permalink
Browse files

make EIGEN_DONT_ALIGN flag work. also remove warnings when using clang.

  • Loading branch information...
1 parent 7a2f91e commit aa2c67d24925a8b9465d5a908662091b705cf7cc @donbright donbright committed Aug 19, 2012
Showing with 19 additions and 7 deletions.
  1. +19 −7 tests/CMakeLists.txt
View
@@ -67,6 +67,17 @@ if(WIN32 AND CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -frounding-math")
endif()
+# Clang compiler
+
+if(CMAKE_CXX_COMPILER MATCHES ".*clang.*")
+ # disable enormous amount of warnings about CGAL
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++11-extensions")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-sign-compare")
+endif()
+
#
# Build test apps
#
@@ -159,6 +170,14 @@ set(CMAKE_INCLUDE_DIRECTORIES_BEFORE OFF)
# Eigen
+
+# Turn off Eigen SIMD optimization
+if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DEIGEN_DONT_ALIGN")
+ endif()
+endif()
+
# First try to find Eigen3. If it's not there, fallback to Eigen2
# Eigen3
@@ -197,13 +216,6 @@ endif()
if (NOT EIGEN3_INCLUDE_DIR)
-# Turn off Eigen SIMD optimization
-if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DEIGEN_DONT_ALIGN")
- endif()
-endif()
-
if (NOT $ENV{EIGEN2DIR} STREQUAL "")
set(EIGEN2_DIR "$ENV{EIGEN2DIR}")
elseif (NOT $ENV{OPENSCAD_LIBRARIES} STREQUAL "")

0 comments on commit aa2c67d

Please sign in to comment.