- Various CMake fixes for two problems.

1) Don't show OSX_COCOA_BACKEND option if the host is not OSX;
2) Don't use the '-msse' compiler flag in dumb/ if the architecture does not support it.
This commit is contained in:
Edoardo Prezioso 2014-12-10 21:11:26 +01:00
parent b2a06f6ccd
commit 372f7e7002
2 changed files with 9 additions and 2 deletions

View file

@ -3,6 +3,7 @@ cmake_minimum_required( VERSION 2.4 )
make_release_only() make_release_only()
include( CheckFunctionExists ) include( CheckFunctionExists )
include( CheckCXXCompilerFlag )
# DUMB is much slower in a Debug build than a Release build, so we force a Release # DUMB is much slower in a Debug build than a Release build, so we force a Release
# build here, since we're not maintaining DUMB, only using it. # build here, since we're not maintaining DUMB, only using it.
@ -104,5 +105,9 @@ add_library( dumb
target_link_libraries( dumb ) target_link_libraries( dumb )
if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE ) if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
set_source_files_properties( src/it/filter.cpp PROPERTIES COMPILE_FLAGS -msse ) CHECK_CXX_COMPILER_FLAG( -msse DUMB_CAN_USE_SSE )
if( DUMB_CAN_USE_SSE )
set_source_files_properties( src/it/filter.cpp PROPERTIES COMPILE_FLAGS -msse )
endif( DUMB_CAN_USE_SSE )
endif( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE ) endif( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )

View file

@ -27,7 +27,9 @@ endif( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
option( DYN_FLUIDSYNTH "Dynamically load fluidsynth" ON ) option( DYN_FLUIDSYNTH "Dynamically load fluidsynth" ON )
option( OSX_COCOA_BACKEND "Use native Cocoa backend instead of SDL" ON ) if( APPLE )
option( OSX_COCOA_BACKEND "Use native Cocoa backend instead of SDL" ON )
endif( APPLE )
if( CMAKE_SIZEOF_VOID_P MATCHES "8" ) if( CMAKE_SIZEOF_VOID_P MATCHES "8" )
set( X64 64 ) set( X64 64 )