| 876 | } |
| 877 | |
| 878 | cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, |
| 879 | Visibility vis, cmMakefile* mf, PerConfig perConfig) |
| 880 | : impl(cm::make_unique<cmTargetInternals>()) |
| 881 | { |
| 882 | assert(mf); |
| 883 | this->impl->TargetType = type; |
| 884 | this->impl->Makefile = mf; |
| 885 | this->impl->Name = name; |
| 886 | this->impl->TemplateTarget = nullptr; |
| 887 | this->impl->IsGeneratorProvided = false; |
| 888 | this->impl->HaveInstallRule = false; |
| 889 | this->impl->IsDLLPlatform = false; |
| 890 | this->impl->IsAIX = false; |
| 891 | this->impl->IsApple = false; |
| 892 | this->impl->IsAndroid = false; |
| 893 | this->impl->IsSymbolic = false; |
| 894 | this->impl->TargetVisibility = vis; |
| 895 | this->impl->BuildInterfaceIncludesAppended = false; |
| 896 | this->impl->PerConfig = (perConfig == PerConfig::Yes); |
| 897 | |
| 898 | // Check whether this is a DLL platform. |
| 899 | this->impl->IsDLLPlatform = |
| 900 | !this->impl->Makefile->GetSafeDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX") |
| 901 | .empty(); |
| 902 | |
| 903 | // Check whether we are targeting AIX. |
| 904 | { |
| 905 | std::string const& systemName = |
| 906 | this->impl->Makefile->GetSafeDefinition("CMAKE_SYSTEM_NAME"); |
| 907 | this->impl->IsAIX = (systemName == "AIX" || systemName == "OS400"); |
| 908 | } |
| 909 | |
| 910 | // Check whether we are targeting Apple. |
| 911 | this->impl->IsApple = this->impl->Makefile->IsOn("APPLE"); |
| 912 | |
| 913 | // Check whether we are targeting an Android platform. |
| 914 | this->impl->IsAndroid = (this->impl->Makefile->GetSafeDefinition( |
| 915 | "CMAKE_SYSTEM_NAME") == "Android"); |
| 916 | |
| 917 | // Save the backtrace of target construction. |
| 918 | this->impl->Backtrace = this->impl->Makefile->GetBacktrace(); |
| 919 | if (this->impl->IsImported()) { |
| 920 | this->impl->FindPackageStack = this->impl->Makefile->GetFindPackageStack(); |
| 921 | } |
| 922 | |
| 923 | if (this->IsNormal()) { |
| 924 | // Initialize the INCLUDE_DIRECTORIES property based on the current value |
| 925 | // of the same directory property: |
| 926 | this->impl->IncludeDirectories.CopyFromEntries( |
| 927 | this->impl->Makefile->GetIncludeDirectoriesEntries()); |
| 928 | |
| 929 | { |
| 930 | auto const& sysInc = this->impl->Makefile->GetSystemIncludeDirectories(); |
| 931 | this->impl->SystemIncludeDirectories.insert(sysInc.begin(), |
| 932 | sysInc.end()); |
| 933 | } |
| 934 | |
| 935 | this->impl->CompileOptions.CopyFromEntries( |
nothing calls this directly
no test coverage detected