xtd 0.2.0
target_id.h
Go to the documentation of this file.
1 #pragma once
5 #include "enum.h"
6 
8 // The following constants are defined in the file xtd_command.cmake.
9 // If the target project is not built with cmake, each constant must be defined by the build tool like this:
10 // | Constant | Value |
11 // | ------------------------------------- | ----- |
12 // | __XTD_TARGET_ID_UNKNOWN__ | 0 |
13 // | __XTD_TARGET_ID_CONSOLE_APPLICATION__ | 1 |
14 // | __XTD_TARGET_ID_GUI_APPLICATION__ | 2 |
15 // | __XTD_TARGET_ID_TEST_APPLICATION__ | 3 |
16 // | __XTD_TARGET_ID_INTERFACE_LIBRARY__ | 4 |
17 // | __XTD_TARGET_ID_MODULE_LIBRARY__ | 5 |
18 // | __XTD_TARGET_ID_SHARED_LIBRARY__ | 6 |
19 // | __XTD_TARGET_ID_STATIC_LIBRARY__ | 7 |
20 // | __XTD_TARGET_ID_CUSTOM_TARGET__ | 8 |
21 #if !defined(__XTD_CURRENT_TARGET_ID__) || !defined(__XTD_TARGET_ID_UNKNOWN__) || !defined(__XTD_TARGET_ID_CONSOLE_APPLICATION__) || !defined(__XTD_TARGET_ID_GUI_APPLICATION__) || !defined(__XTD_TARGET_ID_TEST_APPLICATION__) || !defined(__XTD_TARGET_ID_INTERFACE_LIBRARY__) || !defined(__XTD_TARGET_ID_MODULE_LIBRARY__) || !defined(__XTD_TARGET_ID_SHARED_LIBRARY__) || !defined(__XTD_TARGET_ID_STATIC_LIBRARY__) || !defined(__XTD_TARGET_ID_CUSTOM_TARGET__)
22 #error "Some variables (like __XTD_TARGET_ID__) are not defined. This is probably because you are not using CMake to generate your project. See the following link for more information: https://gammasoft71.github.io/xtd/docs/documentation/Guides/xtd.cmake/Overview..."
23 #endif
24 
27 namespace xtd {
35  enum class target_id {
37  unknown = __XTD_TARGET_ID_UNKNOWN__,
39  console_application = __XTD_TARGET_ID_CONSOLE_APPLICATION__,
41  gui_application = __XTD_TARGET_ID_GUI_APPLICATION__,
43  test_application = __XTD_TARGET_ID_TEST_APPLICATION__,
45  interface_library = __XTD_TARGET_ID_INTERFACE_LIBRARY__,
47  module_library = __XTD_TARGET_ID_MODULE_LIBRARY__,
49  shared_library = __XTD_TARGET_ID_SHARED_LIBRARY__,
51  static_library = __XTD_TARGET_ID_STATIC_LIBRARY__,
53  custom_target = __XTD_TARGET_ID_CUSTOM_TARGET__,
54  };
55 }
56 
58 template<> struct xtd::enum_register<xtd::target_id> {
59  explicit operator auto() const noexcept {return xtd::enum_collection<xtd::target_id> {{xtd::target_id::unknown, "unknown"}, {xtd::target_id::console_application, "console_application"}, {xtd::target_id::gui_application, "gui_application"}, {xtd::target_id::test_application, "test_application"}, {xtd::target_id::interface_library, "interface_library"}, {xtd::target_id::module_library, "module_library"}, {xtd::target_id::shared_library, "shared_library"}, {xtd::target_id::static_library, "static_library"}, {xtd::target_id::custom_target, "custom_target"}};}
60 };
The target is module library.
The target is interface library.
The target is custom target.
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
std::vector< std::pair< enum_t, xtd::ustring > > enum_collection
Represents a pair of an enum_t value and a string of an enum of type enum_t.
Definition: enum_collection.h:19
Contains enum_ and enum_ut_ keywords.
The processor architecture is unknown.
The target is console application.
The target is static library.
target_id
Identifies the target, supported by an assembly.
Definition: target_id.h:35
The target is shared library.
The target is gui application.
The target is test application.
Provides the registration struct for enumerations.
Definition: enum_register.h:36