[llvm] 25ec252 - [CMake] Fix recompile all .inc files with LLVM_OPTIMIZED_TABLEGEN in Visual Studio.
Daniil Fukalov via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 18 00:25:32 PDT 2021
Author: Daniil Fukalov
Date: 2021-08-18T10:24:58+03:00
New Revision: 25ec252537bc70dd8a28726f893d45a6d2753570
URL: https://github.com/llvm/llvm-project/commit/25ec252537bc70dd8a28726f893d45a6d2753570
DIFF: https://github.com/llvm/llvm-project/commit/25ec252537bc70dd8a28726f893d45a6d2753570.diff
LOG: [CMake] Fix recompile all .inc files with LLVM_OPTIMIZED_TABLEGEN in Visual Studio.
After some moment VS solution generated with LLVM_OPTIMIZED_TABLEGEN started to
generate all .inc files for each build. The reason was it had
"<path to native tablegen>/llvm-tblgen" without .exe as a dependency.
Differential Revision: https://reviews.llvm.org/D107898
Added:
Modified:
llvm/cmake/config-ix.cmake
llvm/cmake/modules/CrossCompile.cmake
Removed:
################################################################################
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index 6da2012728ad5..ba5a4a95b03a8 100644
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -690,3 +690,19 @@ if(PY_PYGMENTS_FOUND AND PY_PYGMENTS_LEXERS_C_CPP_FOUND AND PY_YAML_FOUND)
else()
set (LLVM_HAVE_OPT_VIEWER_MODULES 0)
endif()
+
+function(llvm_get_host_prefixes_and_suffixes)
+ include(Platform/${CMAKE_HOST_SYSTEM_NAME} OPTIONAL RESULT_VARIABLE _includedFile)
+ if (_includedFile)
+ set(LLVM_HOST_STATIC_LIBRARY_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX} PARENT_SCOPE)
+ set(LLVM_HOST_STATIC_LIBRARY_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX} PARENT_SCOPE)
+ set(LLVM_HOST_SHARED_LIBRARY_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX} PARENT_SCOPE)
+ set(LLVM_HOST_SHARED_LIBRARY_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX} PARENT_SCOPE)
+ set(LLVM_HOST_IMPORT_LIBRARY_PREFIX ${CMAKE_IMPORT_LIBRARY_PREFIX} PARENT_SCOPE)
+ set(LLVM_HOST_IMPORT_LIBRARY_SUFFIX ${CMAKE_IMPORT_LIBRARY_SUFFIX} PARENT_SCOPE)
+ set(LLVM_HOST_EXECUTABLE_SUFFIX ${CMAKE_EXECUTABLE_SUFFIX} PARENT_SCOPE)
+ set(LLVM_HOST_LINK_LIBRARY_SUFFIX ${CMAKE_LINK_LIBRARY_SUFFIX} PARENT_SCOPE)
+ endif()
+endfunction()
+
+llvm_get_host_prefixes_and_suffixes()
diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake
index 01cd37124841e..179d183ed2b7d 100644
--- a/llvm/cmake/modules/CrossCompile.cmake
+++ b/llvm/cmake/modules/CrossCompile.cmake
@@ -103,6 +103,7 @@ function(build_native_tool target output_path_var)
else()
set(output_path "${${PROJECT_NAME}_NATIVE_BUILD}/bin/${target}")
endif()
+ set(output_path ${output_path}${LLVM_HOST_EXECUTABLE_SUFFIX})
llvm_ExternalProject_BuildCmd(build_cmd ${target} ${${PROJECT_NAME}_NATIVE_BUILD}
CONFIGURATION Release)
More information about the llvm-commits
mailing list