From 83f82ba98de7eedf2d829a783a1540be5c57218c Mon Sep 17 00:00:00 2001 From: derselbst Date: Sat, 8 Jul 2017 20:39:43 +0200 Subject: [PATCH] cmake: let clang use correct compile flags --- fluidsynth/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fluidsynth/CMakeLists.txt b/fluidsynth/CMakeLists.txt index 4118c4c7..54afe090 100644 --- a/fluidsynth/CMakeLists.txt +++ b/fluidsynth/CMakeLists.txt @@ -19,8 +19,8 @@ # CMake based build system. Pedro Lopez-Cabanillas +cmake_minimum_required ( VERSION 3.0.2 ) project ( FluidSynth C ) -cmake_minimum_required ( VERSION 2.6.3 ) set ( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_admin ) # FluidSynth package name @@ -134,7 +134,7 @@ unset ( FLUID_CPPFLAGS CACHE ) unset ( FLUID_LIBS CACHE ) # Options for the GNU C compiler only -if ( CMAKE_COMPILER_IS_GNUCC ) +if ( CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" ) if ( NOT APPLE AND NOT OS2 ) set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed" ) @@ -145,7 +145,7 @@ if ( CMAKE_COMPILER_IS_GNUCC ) set ( CMAKE_C_FLAGS_DEBUG "-g -fvisibility=hidden -DDEBUG ${GNUCC_WARNING_FLAGS}" ) set ( CMAKE_C_FLAGS_RELEASE "-O2 -fomit-frame-pointer -funroll-all-loops -finline-functions -fvisibility=hidden -DNDEBUG ${GNUCC_WARNING_FLAGS}" ) set ( CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -fomit-frame-pointer -funroll-all-loops -finline-functions -fvisibility=hidden -DNDEBUG ${GNUCC_WARNING_FLAGS}" ) -endif ( CMAKE_COMPILER_IS_GNUCC ) +endif ( CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" ) # Windows unset ( WINDOWS_SUPPORT CACHE )