From c6de371eaf90e48ffd76fb2ab434ce7eea54aaf5 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 16 Mar 2016 22:54:36 -0400 Subject: [PATCH] CMakeLists: Use list appending to reduce boilerplate Appending gets rid of the need to respecify the variable name. --- CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d6a4a915a..15ec5617e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,12 +65,12 @@ endif() message(STATUS "Target architecture: ${ARCHITECTURE}") if (NOT MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-attributes -pthread") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") + list(APPEND CMAKE_CXX_FLAGS "-std=c++11 -Wno-attributes -pthread") + list(APPEND CMAKE_C_FLAGS "-pthread") if (ARCHITECTURE_x86_64) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.1") + list(APPEND CMAKE_CXX_FLAGS "-msse4.1") + list(APPEND CMAKE_C_FLAGS "-msse4.1") endif() else() # Silence "deprecation" warnings @@ -160,8 +160,8 @@ IF (APPLE) FIND_LIBRARY(COCOA_LIBRARY Cocoa) # Umbrella framework for everything GUI-related set(PLATFORM_LIBRARIES iconv ${COCOA_LIBRARY} ${IOKIT_LIBRARY} ${COREVIDEO_LIBRARY}) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++") + list(APPEND CMAKE_CXX_FLAGS "-stdlib=libc++") + list(APPEND CMAKE_EXE_LINKER_FLAGS "-stdlib=libc++") ELSEIF(MINGW) # GCC does not support codecvt, so use iconv instead # PSAPI is the Process Status API