summaryrefslogtreecommitdiff
path: root/flang/examples
diff options
context:
space:
mode:
authorShao-Ce SUN <sunshaoce@iscas.ac.cn>2023-03-13 23:44:36 +0800
committerShao-Ce SUN <sunshaoce@iscas.ac.cn>2023-03-14 00:10:57 +0800
commitcbd86cf2e89e43261306d58f9354b2ed74028972 (patch)
tree78b1ead6bf09415dbe87e0b8926f6ec539142382 /flang/examples
parent7ff0b9735dc5803b2820010e05753d02adb8e654 (diff)
downloadllvm-cbd86cf2e89e43261306d58f9354b2ed74028972.tar.gz
[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
Diffstat (limited to 'flang/examples')
-rw-r--r--flang/examples/CMakeLists.txt12
-rw-r--r--flang/examples/ExternalHelloWorld/CMakeLists.txt8
-rw-r--r--flang/examples/ExternalHelloWorld/external-hello.cpp (renamed from flang/examples/external-hello.cpp)0
3 files changed, 10 insertions, 10 deletions
diff --git a/flang/examples/CMakeLists.txt b/flang/examples/CMakeLists.txt
index b0a78eeaa4ea..e1a309f1a7a9 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 000000000000..3ca9feddf33e
--- /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
index 4991bf9eba99..4991bf9eba99 100644
--- a/flang/examples/external-hello.cpp
+++ b/flang/examples/ExternalHelloWorld/external-hello.cpp