Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] r1937 - trunk/CMake


Chronological Thread 
  • From: bigler@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [Manta] r1937 - trunk/CMake
  • Date: Tue, 18 Dec 2007 15:20:48 -0700 (MST)

Author: bigler
Date: Tue Dec 18 15:20:47 2007
New Revision: 1937

Modified:
   trunk/CMake/CheckSSE.cmake
   trunk/CMake/ConfigCompilerFlags.cmake
Log:
CMake/CheckSSE.cmake

  Added some comments.

  Change SSE_FLAGS to MANTA_SSE_FLAGS (It's used elsewhere now).
  
CMake/ConfigCompilerFlags.cmake

  Set C_FLAGS and CXX_FLAGS to the INIT versions of the variables.
  These seem to have reasonable defaults on most systems.

  Add MANTA_SSE_FLAGS to the initial set of flags.  This fixes a bug
  that was reported.  CMAKE_CXX_FLAGS were being overwriten by
  ConfigCompilerFlags, and that flag had the SSE_FLAGS in them.


Modified: trunk/CMake/CheckSSE.cmake
==============================================================================
--- trunk/CMake/CheckSSE.cmake  (original)
+++ trunk/CMake/CheckSSE.cmake  Tue Dec 18 15:20:47 2007
@@ -1,3 +1,11 @@
+# MANTA_SSE_FLAGS contain flags needed for SSE compilation
+#
+# Cache variables:
+# MANTA_SSE      - If SSE is enabled.  It will be forcibly disabled if
+#                  no SSE support found.
+# MANTA_SSE_GCC  - If the epi64x intrinsics are present
+# MANTA_SSE_CAST - If the casting intrinsics are present
+# MANTA_SSE_TEST_VERBOSE - Make the detection more chatty
 
 
 ##################################################################
@@ -27,13 +35,13 @@
   ENDIF(MANTA_SSE_TEST_VERBOSE)
 
   IF (USING_WINDOWS_CL)
-    SET(SSE_FLAGS "/arch:SSE2")
+    SET(MANTA_SSE_FLAGS "/arch:SSE2")
   ELSE(USING_WINDOWS_CL)
-    SET(SSE_FLAGS "-msse -msse2")
+    SET(MANTA_SSE_FLAGS "-msse -msse2")
   ENDIF(USING_WINDOWS_CL)
 
   SET(SAFE_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SSE_FLAGS}" CACHE STRING "" 
FORCE)
+  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MANTA_SSE_FLAGS}" CACHE STRING 
"" FORCE)
 
   # Test again.
   TRY_COMPILE(MANTA_SSE_TEST_RESULT ${CMAKE_BINARY_DIR}/testSSE 
${SSE_TEST_FILE}
@@ -105,7 +113,7 @@
 ELSE(MANTA_SSE_TEST_RESULT) # All tests failed.
 
   IF(MANTA_SSE)
-    MESSAGE("Couldn't compile with sse (already tried ${SSE_FLAGS} 
options..).")
+    MESSAGE("Couldn't compile with sse (already tried ${MANTA_SSE_FLAGS} 
options..).")
     MESSAGE("--debug-trycompile may be passed to CMake to avoid cleaning up 
temporary TRY_COMPILE files.")
     MESSAGE("Also try setting MANTA_SSE_TEST_VERBOSE to true in the advanced 
options to see compiler output.")
     MESSAGE("compiler:       " ${CMAKE_CXX_COMPILER})

Modified: trunk/CMake/ConfigCompilerFlags.cmake
==============================================================================
--- trunk/CMake/ConfigCompilerFlags.cmake       (original)
+++ trunk/CMake/ConfigCompilerFlags.cmake       Tue Dec 18 15:20:47 2007
@@ -55,6 +55,16 @@
 SET(GCC_OPT " ")
 SET(CL_OPT " ")
 
+# Set some defaults.  CMake provides some defaults in the INIT
+# versions of the variables.
+APPEND_TO_STRING(C_FLAGS "${CMAKE_C_FLAGS_INIT}")
+#
+APPEND_TO_STRING(CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT}")
+
+# SSE flags
+APPEND_TO_STRING(C_FLAGS "${MANTA_SSE_FLAGS}")
+APPEND_TO_STRING(CXX_FLAGS "${MANTA_SSE_FLAGS}")
+
 # Set the default warning levels for each compiler
 
 ####################
@@ -102,9 +112,6 @@
 
 SET(WARNING_FLAGS "/wd4305 /wd4996")
 IF (USING_WINDOWS_CL)
-  # These have good defaults
-  APPEND_TO_STRING(C_FLAGS         ${CMAKE_C_FLAGS_INIT})
-  APPEND_TO_STRING(CXX_FLAGS         ${CMAKE_CXX_FLAGS_INIT})
   # These are the warnings
   APPEND_TO_STRING(C_FLAGS         ${WARNING_FLAGS})
   APPEND_TO_STRING(CXX_FLAGS         ${WARNING_FLAGS})
@@ -112,9 +119,6 @@
 
 SET(WARNING_FLAGS "/D_CRT_SECURE_NO_DEPRECATE=1 /Qstd=c99")
 IF (USING_WINDOWS_ICL)
-  # These have good defaults
-  APPEND_TO_STRING(C_FLAGS         ${CMAKE_C_FLAGS_INIT})
-  APPEND_TO_STRING(CXX_FLAGS         ${CMAKE_CXX_FLAGS_INIT})
   # These are the warnings
   APPEND_TO_STRING(C_FLAGS         ${WARNING_FLAGS})
   APPEND_TO_STRING(CXX_FLAGS         ${WARNING_FLAGS})




  • [Manta] r1937 - trunk/CMake, bigler, 12/18/2007

Archive powered by MHonArc 2.6.16.

Top of page