Update CMakeLists.txt (#770)

This fixes the build errors that look like:

    source file is not valid UTF-8

This was due to CMake adding object files to the command line after the `-x` argument, which caused them to be interpreted as Objective C++ source code.
This commit is contained in:
Philip Rideout 2020-11-18 00:17:20 -08:00 committed by GitHub
parent 400d9bd8a3
commit 6e2c1a3a6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -127,7 +127,11 @@ endif()
IF(MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
ELSEIF(APPLE)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fobjc-arc -ObjC++")
ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fobjc-arc -xobjective-c++")
ENDIF()
ENDIF(MSVC)
IF(WIN32)