Skip to content

Commit

Permalink
Revert "[gn] port f29cfab"
Browse files Browse the repository at this point in the history
This reverts commit 1995635.
f29cfab was reverted in c6c5413.
  • Loading branch information
nico committed Jan 5, 2023
1 parent 39a83eb commit ff66d41
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 29 deletions.
4 changes: 1 addition & 3 deletions llvm/unittests/Analysis/InlineAdvisorPlugin/CMakeLists.txt
Expand Up @@ -10,9 +10,7 @@ if (NOT WIN32)
endif()

unset(LLVM_LINK_COMPONENTS)
add_llvm_library(InlineAdvisorPlugin MODULE BUILDTREE_ONLY
InlineAdvisorPlugin.cpp
)
add_llvm_library(InlineAdvisorPlugin MODULE BUILDTREE_ONLY InlineAdvisorPlugin.cpp)
# Put PLUGIN next to the unit test executable.
set_output_directory(InlineAdvisorPlugin
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/../
Expand Down
28 changes: 27 additions & 1 deletion llvm/utils/gn/secondary/llvm/unittests/Analysis/BUILD.gn
@@ -1,5 +1,31 @@
import("//third-party/unittest/unittest.gni")

# Keyed off LLVM_ENABLE_PLUGINS in the CMake build, which is usually false
# on Windows and true elsewhere.
if (host_os != "win") {
foreach(plugin, [ "InlineAdvisorPlugin" ]) {
loadable_module(plugin) {
# Put plugin next to the unit test executable.
output_dir = target_out_dir

sources = [ "$plugin.cpp" ]

deps = [
# TestPlugin doesn't want to link in any LLVM code, it just needs its
# headers.
"//llvm/include/llvm/IR:public_tablegen",
]

if (host_os != "mac" && host_os != "win") {
# The GN build currently doesn't globally pass -fPIC, but that's
# needed for building .so files on ELF. Just pass it manually
# for loadable_modules for now.
cflags = [ "-fPIC" ]
}
}
}
}

unittest("AnalysisTests") {
deps = [
"//llvm/lib/Analysis",
Expand Down Expand Up @@ -58,7 +84,7 @@ unittest("AnalysisTests") {
# Otherwise, reconfiguring with plugins disabled will leave behind a stale
# executable.
if (host_os != "win") {
deps += [ "InlineAdvisorPlugin" ]
deps += [ ":InlineAdvisorPlugin" ]
}

# Support plugins.
Expand Down

This file was deleted.

0 comments on commit ff66d41

Please sign in to comment.