Author: phosek Date: Sat Apr 15 21:25:55 2017 New Revision: 300409 URL: http://llvm.org/viewvc/llvm-project?rev=300409&view=rev Log: [CMake][libcxx] Fix the --target and --gcc-toolchain flag handling
CMake has the problem with the single dash variant because of the space, so use the double dash with equal sign version. We also don't have to pass the target triple when checking for compiler-rt since that flag is already included in compile flags now. Differential Revision: https://reviews.llvm.org/D32068 Modified: libcxx/trunk/CMakeLists.txt libcxx/trunk/cmake/Modules/HandleCompilerRT.cmake Modified: libcxx/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=300409&r1=300408&r2=300409&view=diff ============================================================================== --- libcxx/trunk/CMakeLists.txt (original) +++ libcxx/trunk/CMakeLists.txt Sat Apr 15 21:25:55 2017 @@ -370,9 +370,9 @@ include(HandleLibcxxFlags) # 'config-ix' use them during feature checks. It also adds them to both # 'LIBCXX_COMPILE_FLAGS' and 'LIBCXX_LINK_FLAGS' add_target_flags_if(LIBCXX_BUILD_32_BITS "-m32") -add_target_flags_if(LIBCXX_TARGET_TRIPLE "-target ${LIBCXX_TARGET_TRIPLE}") +add_target_flags_if(LIBCXX_TARGET_TRIPLE "--target=${LIBCXX_TARGET_TRIPLE}") add_target_flags_if(LIBCXX_SYSROOT "--sysroot=${LIBCXX_SYSROOT}") -add_target_flags_if(LIBCXX_GCC_TOOLCHAIN "-gcc-toolchain ${LIBCXX_GCC_TOOLCHAIN}") +add_target_flags_if(LIBCXX_GCC_TOOLCHAIN "--gcc-toolchain=${LIBCXX_GCC_TOOLCHAIN}") if (LIBCXX_TARGET_TRIPLE) set(TARGET_TRIPLE "${LIBCXX_TARGET_TRIPLE}") endif() Modified: libcxx/trunk/cmake/Modules/HandleCompilerRT.cmake URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleCompilerRT.cmake?rev=300409&r1=300408&r2=300409&view=diff ============================================================================== --- libcxx/trunk/cmake/Modules/HandleCompilerRT.cmake (original) +++ libcxx/trunk/cmake/Modules/HandleCompilerRT.cmake Sat Apr 15 21:25:55 2017 @@ -3,7 +3,7 @@ function(find_compiler_rt_library name d message(FATAL_ERROR "LIBCXX_COMPILE_FLAGS must be defined when using this function") endif() set(dest "" PARENT_SCOPE) - set(CLANG_COMMAND ${CMAKE_CXX_COMPILER} ${TARGET_TRIPLE} ${LIBCXX_COMPILE_FLAGS} + set(CLANG_COMMAND ${CMAKE_CXX_COMPILER} ${LIBCXX_COMPILE_FLAGS} "--rtlib=compiler-rt" "--print-libgcc-file-name") if (CMAKE_CXX_COMPILER_ID MATCHES Clang AND CMAKE_CXX_COMPILER_TARGET) list(APPEND CLANG_COMMAND "--target=${CMAKE_CXX_COMPILER_TARGET}") _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits