[flang-commits] [flang] cbd86cf - [flang][nfc] Avoid generating external-hello-world by default

Shao-Ce SUN via flang-commits flang-commits at lists.llvm.org
Mon Mar 13 09:11:04 PDT 2023


Author: Shao-Ce SUN
Date: 2023-03-14T00:10:57+08:00
New Revision: cbd86cf2e89e43261306d58f9354b2ed74028972

URL: https://github.com/llvm/llvm-project/commit/cbd86cf2e89e43261306d58f9354b2ed74028972
DIFF: https://github.com/llvm/llvm-project/commit/cbd86cf2e89e43261306d58f9354b2ed74028972.diff

LOG: [flang][nfc] Avoid generating external-hello-world by default

The current setting is not working.
When compiling `flang`, the `external-hello-world` is still compiled by default.

Reviewed By: luporl

Differential Revision: https://reviews.llvm.org/D145877

Added: 
    flang/examples/ExternalHelloWorld/CMakeLists.txt
    flang/examples/ExternalHelloWorld/external-hello.cpp

Modified: 
    flang/examples/CMakeLists.txt

Removed: 
    flang/examples/external-hello.cpp


################################################################################
diff  --git a/flang/examples/CMakeLists.txt b/flang/examples/CMakeLists.txt
index b0a78eeaa4eaa..e1a309f1a7a97 100644
--- a/flang/examples/CMakeLists.txt
+++ b/flang/examples/CMakeLists.txt
@@ -1,15 +1,7 @@
 if(NOT FLANG_BUILD_EXAMPLES)
-  set(EXCLUDE_FROM_ALL ON)
+  set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL ON)
 endif()
 
-# This test is not run by default as it requires input.
-add_executable(external-hello-world
-  external-hello.cpp
-)
-
-target_link_libraries(external-hello-world
-  FortranRuntime
-)
-
+add_subdirectory(ExternalHelloWorld)
 add_subdirectory(PrintFlangFunctionNames)
 add_subdirectory(FlangOmpReport)

diff  --git a/flang/examples/ExternalHelloWorld/CMakeLists.txt b/flang/examples/ExternalHelloWorld/CMakeLists.txt
new file mode 100644
index 0000000000000..3ca9feddf33e9
--- /dev/null
+++ b/flang/examples/ExternalHelloWorld/CMakeLists.txt
@@ -0,0 +1,8 @@
+# This test is not run by default as it requires input.
+add_executable(external-hello-world
+  external-hello.cpp
+)
+
+target_link_libraries(external-hello-world
+  FortranRuntime
+)

diff  --git a/flang/examples/external-hello.cpp b/flang/examples/ExternalHelloWorld/external-hello.cpp
similarity index 100%
rename from flang/examples/external-hello.cpp
rename to flang/examples/ExternalHelloWorld/external-hello.cpp


        


More information about the flang-commits mailing list