diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-01-30 03:53:11 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-01-30 14:25:31 (GMT) |
commit | 9bb824a237117a6d0b9ed6826ace2845645fecab (patch) | |
tree | e445ec7bfcb71722552d65a48d4c5a373c685ca0 /Source/cmTarget.cxx | |
parent | 7ac338be9830bdc936b52a4135504ed011418f3c (diff) | |
download | CMake-9bb824a237117a6d0b9ed6826ace2845645fecab.zip CMake-9bb824a237117a6d0b9ed6826ace2845645fecab.tar.gz CMake-9bb824a237117a6d0b9ed6826ace2845645fecab.tar.bz2 |
cmTarget: put compile-related properties in a group
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 110 |
1 files changed, 66 insertions, 44 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 37f9e98..df2d9c6 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -501,17 +501,77 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, // Setup default property values. if (this->CanCompileSources()) { + // Compilation properties + initProp("INTERPROCEDURAL_OPTIMIZATION"); + // initProp("INTERPROCEDURAL_OPTIMIZATION_<CONFIG>"); (per-config block) + initProp("NO_SYSTEM_FROM_IMPORTED"); + initProp("VISIBILITY_INLINES_HIDDEN"); + initProp("COMPILE_WARNING_AS_ERROR"); + // -- Features + // ---- PCH + initProp("DISABLE_PRECOMPILE_HEADERS"); + initPropValue("PCH_WARN_INVALID", "ON"); + initPropValue("PCH_INSTANTIATE_TEMPLATES", "ON"); + // -- Platforms + // ---- Android + initProp("ANDROID_API"); + initProp("ANDROID_API_MIN"); + initProp("ANDROID_ARCH"); + initProp("ANDROID_ASSETS_DIRECTORIES"); + initProp("ANDROID_JAVA_SOURCE_DIR"); + initProp("ANDROID_STL_TYPE"); + // ---- macOS + initProp("OSX_ARCHITECTURES"); + // ---- Windows + initProp("MSVC_DEBUG_INFORMATION_FORMAT"); + initProp("MSVC_RUNTIME_LIBRARY"); + initProp("VS_JUST_MY_CODE_DEBUGGING"); + // ---- OpenWatcom + initProp("WATCOM_RUNTIME_LIBRARY"); + // -- Language + // ---- C SETUP_COMMON_LANGUAGE_PROPERTIES(C); - SETUP_COMMON_LANGUAGE_PROPERTIES(OBJC); + // ---- C++ SETUP_COMMON_LANGUAGE_PROPERTIES(CXX); - SETUP_COMMON_LANGUAGE_PROPERTIES(OBJCXX); + // ---- CUDA SETUP_COMMON_LANGUAGE_PROPERTIES(CUDA); + initProp("CUDA_SEPARABLE_COMPILATION"); + initProp("CUDA_ARCHITECTURES"); + // ---- Fortran + initProp("Fortran_FORMAT"); + initProp("Fortran_MODULE_DIRECTORY"); + initProp("Fortran_COMPILER_LAUNCHER"); + initProp("Fortran_PREPROCESS"); + initProp("Fortran_VISIBILITY_PRESET"); + // ---- HIP SETUP_COMMON_LANGUAGE_PROPERTIES(HIP); + initProp("HIP_ARCHITECTURES"); + // ---- ISPC + initProp("ISPC_COMPILER_LAUNCHER"); + initProp("ISPC_HEADER_DIRECTORY"); + initPropValue("ISPC_HEADER_SUFFIX", "_ispc.h"); + initProp("ISPC_INSTRUCTION_SETS"); + // ---- Objective C + SETUP_COMMON_LANGUAGE_PROPERTIES(OBJC); + // ---- Objective C++ + SETUP_COMMON_LANGUAGE_PROPERTIES(OBJCXX); + // ---- Swift + initProp("Swift_LANGUAGE_VERSION"); + initProp("Swift_MODULE_DIRECTORY"); + // ---- moc + initProp("AUTOMOC"); + initProp("AUTOMOC_COMPILER_PREDEFINES"); + initProp("AUTOMOC_MACRO_NAMES"); + initProp("AUTOMOC_MOC_OPTIONS"); + initProp("AUTOMOC_PATH_PREFIX"); + // ---- uic + initProp("AUTOUIC"); + initProp("AUTOUIC_OPTIONS"); + initProp("AUTOUIC_SEARCH_PATHS"); + // ---- rcc + initProp("AUTORCC"); + initProp("AUTORCC_OPTIONS"); - initProp("ANDROID_API"); - initProp("ANDROID_API_MIN"); - initProp("ANDROID_ARCH"); - initProp("ANDROID_STL_TYPE"); initProp("ANDROID_SKIP_ANT_STEP"); initProp("ANDROID_PROCESS_MAX"); initProp("ANDROID_PROGUARD"); @@ -519,10 +579,8 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, initProp("ANDROID_SECURE_PROPS_PATH"); initProp("ANDROID_NATIVE_LIB_DIRECTORIES"); initProp("ANDROID_NATIVE_LIB_DEPENDENCIES"); - initProp("ANDROID_JAVA_SOURCE_DIR"); initProp("ANDROID_JAR_DIRECTORIES"); initProp("ANDROID_JAR_DEPENDENCIES"); - initProp("ANDROID_ASSETS_DIRECTORIES"); initProp("ANDROID_ANT_ADDITIONAL_OPTIONS"); initProp("BUILD_RPATH"); initProp("BUILD_RPATH_USE_ORIGIN"); @@ -531,7 +589,6 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, initProp("INSTALL_REMOVE_ENVIRONMENT_RPATH"); initPropValue("INSTALL_RPATH", ""); initPropValue("INSTALL_RPATH_USE_LINK_PATH", "OFF"); - initProp("INTERPROCEDURAL_OPTIMIZATION"); initPropValue("SKIP_BUILD_RPATH", "OFF"); initPropValue("BUILD_WITH_INSTALL_RPATH", "OFF"); initProp("ARCHIVE_OUTPUT_DIRECTORY"); @@ -541,36 +598,16 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, initProp("COMPILE_PDB_OUTPUT_DIRECTORY"); initProp("FRAMEWORK"); initProp("FRAMEWORK_MULTI_CONFIG_POSTFIX"); - initProp("Fortran_FORMAT"); - initProp("Fortran_MODULE_DIRECTORY"); - initProp("Fortran_COMPILER_LAUNCHER"); - initProp("Fortran_PREPROCESS"); - initProp("Fortran_VISIBILITY_PRESET"); initProp("GNUtoMS"); - initProp("OSX_ARCHITECTURES"); initProp("IOS_INSTALL_COMBINED"); - initProp("AUTOMOC"); - initProp("AUTOUIC"); - initProp("AUTORCC"); initProp("AUTOGEN_ORIGIN_DEPENDS"); initProp("AUTOGEN_PARALLEL"); - initProp("AUTOMOC_COMPILER_PREDEFINES"); initProp("AUTOMOC_DEPEND_FILTERS"); - initProp("AUTOMOC_MACRO_NAMES"); - initProp("AUTOMOC_MOC_OPTIONS"); - initProp("AUTOUIC_OPTIONS"); - initProp("AUTOMOC_PATH_PREFIX"); - initProp("AUTOUIC_SEARCH_PATHS"); - initProp("AUTORCC_OPTIONS"); initProp("LINK_DEPENDS_NO_SHARED"); initProp("LINK_INTERFACE_LIBRARIES"); - initProp("MSVC_DEBUG_INFORMATION_FORMAT"); - initProp("MSVC_RUNTIME_LIBRARY"); - initProp("WATCOM_RUNTIME_LIBRARY"); initProp("WIN32_EXECUTABLE"); initProp("MACOSX_BUNDLE"); initProp("MACOSX_RPATH"); - initProp("NO_SYSTEM_FROM_IMPORTED"); initProp("BUILD_WITH_INSTALL_NAME_DIR"); initProp("C_CLANG_TIDY"); initProp("C_CLANG_TIDY_EXPORT_FIXES_DIR"); @@ -585,20 +622,12 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, initProp("CXX_CPPCHECK"); initProp("CXX_INCLUDE_WHAT_YOU_USE"); initProp("CXX_LINKER_LAUNCHER"); - initProp("CUDA_SEPARABLE_COMPILATION"); initProp("CUDA_RESOLVE_DEVICE_SYMBOLS"); initProp("CUDA_RUNTIME_LIBRARY"); - initProp("CUDA_ARCHITECTURES"); initProp("HIP_RUNTIME_LIBRARY"); - initProp("HIP_ARCHITECTURES"); - initProp("VISIBILITY_INLINES_HIDDEN"); initProp("JOB_POOL_COMPILE"); initProp("JOB_POOL_LINK"); initProp("JOB_POOL_PRECOMPILE_HEADER"); - initProp("ISPC_COMPILER_LAUNCHER"); - initProp("ISPC_HEADER_DIRECTORY"); - initPropValue("ISPC_HEADER_SUFFIX", "_ispc.h"); - initProp("ISPC_INSTRUCTION_SETS"); initProp("LINK_SEARCH_START_STATIC"); initProp("LINK_SEARCH_END_STATIC"); initProp("OBJC_CLANG_TIDY"); @@ -607,20 +636,13 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, initProp("OBJCXX_CLANG_TIDY"); initProp("OBJCXX_CLANG_TIDY_EXPORT_FIXES_DIR"); initProp("OBJCXX_LINKER_LAUNCHER"); - initProp("Swift_LANGUAGE_VERSION"); - initProp("Swift_MODULE_DIRECTORY"); - initProp("VS_JUST_MY_CODE_DEBUGGING"); initProp("VS_NO_COMPILE_BATCHING"); - initProp("DISABLE_PRECOMPILE_HEADERS"); initProp("UNITY_BUILD"); initProp("UNITY_BUILD_UNIQUE_ID"); initProp("OPTIMIZE_DEPENDENCIES"); initProp("EXPORT_COMPILE_COMMANDS"); - initProp("COMPILE_WARNING_AS_ERROR"); initPropValue("UNITY_BUILD_BATCH_SIZE", "8"); initPropValue("UNITY_BUILD_MODE", "BATCH"); - initPropValue("PCH_WARN_INVALID", "ON"); - initPropValue("PCH_INSTANTIATE_TEMPLATES", "ON"); #ifdef __APPLE__ if (this->GetGlobalGenerator()->IsXcode()) { |