Skip to content

[llvm] Enable building Analysis plugins on windows #112303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

fsfod
Copy link
Contributor

@fsfod fsfod commented Oct 15, 2024

Enable building InlineAdvisorPlugin and InlineOrderPlugin on windows for shared library builds.

This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and LLVM plugins on window.

Enable building InlineAdvisorPlugin and InlineOrderPlugin on windows for
shared library builds.

This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and LLVM plugins on window.
@llvmbot
Copy link
Member

llvmbot commented Oct 15, 2024

@llvm/pr-subscribers-llvm-analysis

Author: Thomas Fransham (fsfod)

Changes

Enable building InlineAdvisorPlugin and InlineOrderPlugin on windows for shared library builds.

This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and LLVM plugins on window.


Full diff: https://github.com/llvm/llvm-project/pull/112303.diff

2 Files Affected:

  • (modified) llvm/unittests/Analysis/InlineAdvisorPlugin/CMakeLists.txt (+1-1)
  • (modified) llvm/unittests/Analysis/InlineOrderPlugin/CMakeLists.txt (+1-1)
diff --git a/llvm/unittests/Analysis/InlineAdvisorPlugin/CMakeLists.txt b/llvm/unittests/Analysis/InlineAdvisorPlugin/CMakeLists.txt
index 22cd0cb1d9a034..deabf110f2e439 100644
--- a/llvm/unittests/Analysis/InlineAdvisorPlugin/CMakeLists.txt
+++ b/llvm/unittests/Analysis/InlineAdvisorPlugin/CMakeLists.txt
@@ -2,7 +2,7 @@
 # libraries, but expects them to exist in the process loading the plugin. This 
 # doesn't work with DLLs on Windows (where a shared library can't have undefined
 # references), so just skip this testcase on Windows.
-if (NOT WIN32 AND NOT CYGWIN)
+if ((NOT WIN32 OR LLVM_BUILD_LLVM_DYLIB) AND NOT CYGWIN)
   unset(LLVM_LINK_COMPONENTS)
   add_llvm_library(InlineAdvisorPlugin MODULE BUILDTREE_ONLY
     InlineAdvisorPlugin.cpp
diff --git a/llvm/unittests/Analysis/InlineOrderPlugin/CMakeLists.txt b/llvm/unittests/Analysis/InlineOrderPlugin/CMakeLists.txt
index cc470a934426d5..0b37cebe3da6de 100644
--- a/llvm/unittests/Analysis/InlineOrderPlugin/CMakeLists.txt
+++ b/llvm/unittests/Analysis/InlineOrderPlugin/CMakeLists.txt
@@ -2,7 +2,7 @@
 # libraries, but expects them to exist in the process loading the plugin. This 
 # doesn't work with DLLs on Windows (where a shared library can't have undefined
 # references), so just skip this testcase on Windows.
-if (NOT WIN32 AND NOT CYGWIN)
+if ((NOT WIN32 OR LLVM_BUILD_LLVM_DYLIB) AND NOT CYGWIN)
   unset(LLVM_LINK_COMPONENTS)
   add_llvm_library(InlineOrderPlugin MODULE BUILDTREE_ONLY
     InlineOrderPlugin.cpp

@vgvassilev vgvassilev requested a review from dwblaikie October 23, 2024 18:28
@vgvassilev
Copy link
Contributor

Hi @dwblaikie, this lgtm but since I could not find an obvious reviewer maybe that's around an area you have experience with?

Copy link
Collaborator

@dwblaikie dwblaikie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I guess - best of luck :)

@vgvassilev vgvassilev merged commit 69ead94 into llvm:main Oct 26, 2024
10 checks passed
@vgvassilev
Copy link
Contributor

Sure, I guess - best of luck :)

Thank you!

winner245 pushed a commit to winner245/llvm-project that referenced this pull request Oct 26, 2024
Enable building InlineAdvisorPlugin and InlineOrderPlugin on windows for
shared library builds.

This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and LLVM
plugins on window.
NoumanAmir657 pushed a commit to NoumanAmir657/llvm-project that referenced this pull request Nov 4, 2024
Enable building InlineAdvisorPlugin and InlineOrderPlugin on windows for
shared library builds.

This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and LLVM
plugins on window.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants