Clang doesn't support some flags that GCC does, so conditionally check the compiler and add them if we are doing a GCC build

This commit is contained in:
Forrest McDonald 2014-07-12 09:52:27 -07:00 committed by Gregory Hainaut
parent c60fefa1a6
commit b24d4cce8d
5 changed files with 27 additions and 12 deletions

View File

@ -11,10 +11,7 @@ set(Output Utilities)
# set common flags # set common flags
set(CommonFlags set(CommonFlags
-fno-dse
-fno-guess-branch-probability
-fno-strict-aliasing -fno-strict-aliasing
-fno-tree-dse
) )
# set optimization flags # set optimization flags
@ -58,6 +55,11 @@ set(OptimizationFlags
-ftree-vrp -ftree-vrp
-funit-at-a-time) -funit-at-a-time)
#Clang doesn't support a few common flags that GCC does.
if(NOT USE_CLANG)
add_definitions(${CommonFlags} -fno-guess-branch-probability -fno-dse -fno-tree-dse)
endif(NOT USE_CLANG)
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)

View File

@ -11,9 +11,6 @@ set(Output x86emitter)
# set common flags # set common flags
set(CommonFlags set(CommonFlags
-fno-guess-branch-probability
-fno-dse
-fno-tree-dse
-fno-strict-aliasing -fno-strict-aliasing
) )
@ -58,6 +55,11 @@ set(OptimizationFlags
-ftree-vrp -ftree-vrp
-funit-at-a-time) -funit-at-a-time)
#Clang doesn't support a few common flags that GCC does.
if(NOT USE_CLANG)
add_definitions(${CommonFlags} -fno-guess-branch-probability -fno-dse -fno-tree-dse)
endif(NOT USE_CLANG)
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)

View File

@ -12,14 +12,12 @@ set(CommonFlags
# Disable this optimization for the moment # Disable this optimization for the moment
-fno-omit-frame-pointer -fno-omit-frame-pointer
# END GCC-4.6 # END GCC-4.6
-fno-guess-branch-probability
-fno-dse
-fno-tree-dse
-fno-strict-aliasing -fno-strict-aliasing
-Wno-parentheses -Wno-parentheses
-Wstrict-aliasing # Allow to track strict aliasing issue. -Wstrict-aliasing # Allow to track strict aliasing issue.
-Wno-char-subscripts # only impact svu which is deprecated -Wno-char-subscripts # only impact svu which is deprecated
-Wno-missing-braces -Wno-missing-braces
-Wno-ignored-attributes
) )
# set optimization flags # set optimization flags
@ -63,6 +61,11 @@ set(OptimizationFlags
-ftree-vrp -ftree-vrp
-funit-at-a-time) -funit-at-a-time)
#Clang doesn't support a few common flags that GCC does.
if(NOT USE_CLANG)
add_definitions(${CommonFlags} -fno-guess-branch-probability -fno-dse -fno-tree-dse)
endif(NOT USE_CLANG)
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
set(Output pcsx2-dbg) set(Output pcsx2-dbg)

View File

@ -12,7 +12,6 @@ set(Output GSdx-0.1.16)
set(CommonFlags set(CommonFlags
-D_LINUX -D_LINUX
-fno-operator-names # because Xbyak uses and()/xor()/or()/not() function -fno-operator-names # because Xbyak uses and()/xor()/or()/not() function
-mpreferred-stack-boundary=2
-mfpmath=sse -mfpmath=sse
#-Wstrict-aliasing # Allow to track strict aliasing issue. #-Wstrict-aliasing # Allow to track strict aliasing issue.
-std=c++0x -std=c++0x
@ -27,6 +26,11 @@ set(OptimizationFlags
-DNDEBUG -DNDEBUG
) )
#Clang doesn't support a few common flags that GCC does.
if(NOT USE_CLANG)
add_definitions(${CommonFlags} -mpreferred-stack-boundary=2)
endif(NOT USE_CLANG)
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
add_definitions(${CommonFlags} -D_DEBUG -g -Wall) add_definitions(${CommonFlags} -D_DEBUG -g -Wall)

View File

@ -16,7 +16,6 @@ set(Output zzogl-0.4.0)
set(CommonFlags set(CommonFlags
-pthread -pthread
-DZEROGS_SSE2 -DZEROGS_SSE2
-fno-regmove
-fno-strict-aliasing -fno-strict-aliasing
-Wstrict-aliasing # Allow to track strict aliasing issue. -Wstrict-aliasing # Allow to track strict aliasing issue.
-Wunused-variable -Wunused-variable
@ -27,6 +26,11 @@ set(OptimizationFlags
-DNDEBUG -DNDEBUG
) )
#Clang doesn't support a few common flags that GCC does.
if(NOT USE_CLANG)
add_definitions(${CommonFlags} -fno-regmove)
endif(NOT USE_CLANG)
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines