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