set(dir "${CMAKE_CURRENT_BINARY_DIR}") set(properties # property expected alias # Compilation properties "COMPILE_WARNING_AS_ERROR" "ON" "" "INTERPROCEDURAL_OPTIMIZATION" "OFF" "" "NO_SYSTEM_FROM_IMPORTED" "ON" "" "VISIBILITY_INLINES_HIDDEN" "ON" "" ## Features ### PCH "DISABLE_PRECOMPILE_HEADERS" "ON" "" "PCH_WARN_INVALID" "OFF" "" "PCH_INSTANTIATE_TEMPLATES" "OFF" "" ## Platforms ### Android "ANDROID_API" "9" "" "ANDROID_API_MIN" "9" "" "ANDROID_ARCH" "arm64-v8a" "" "ANDROID_ASSETS_DIRECTORIES" "${dir}" "" "ANDROID_JAVA_SOURCE_DIR" "${dir}" "" "ANDROID_STL_TYPE" "system" "" ### macOS "OSX_ARCHITECTURES" "arm64" "" ### Windows "MSVC_DEBUG_INFORMATION_FORMAT" "Embedded" "" "MSVC_RUNTIME_LIBRARY" "MultiThreaded" "" "VS_JUST_MY_CODE_DEBUGGING" "ON" "" ### OpenWatcom "WATCOM_RUNTIME_LIBRARY" "MultiThreaded" "" ## Language ### CUDA "CUDA_SEPARABLE_COMPILATION" "ON" "" "CUDA_ARCHITECTURES" "naive" "" ### Fortran "Fortran_FORMAT" "FREE" "" "Fortran_MODULE_DIRECTORY" "${dir}" "" "Fortran_COMPILER_LAUNCHER" "ccache" "" "Fortran_PREPROCESS" "ON" "" "Fortran_VISIBILITY_PRESET" "hidden" "" ### HIP "HIP_ARCHITECTURES" "gfx801" "" ### ISPC "ISPC_COMPILER_LAUNCHER" "ccache" "" "ISPC_HEADER_DIRECTORY" "${dir}" "" "ISPC_HEADER_SUFFIX" "_i.h" "" "ISPC_INSTRUCTION_SETS" "avx2-i32x4" "" ### Swift "Swift_LANGUAGE_VERSION" "2.3" "" "Swift_MODULE_DIRECTORY" "${dir}" "" ### moc "AUTOMOC" "OFF" "" "AUTOMOC_COMPILER_PREDEFINES" "OFF" "" "AUTOMOC_MACRO_NAMES" "MOC_CLASS" "" "AUTOMOC_MOC_OPTIONS" "-v" "" "AUTOMOC_PATH_PREFIX" "moc_" "" "AUTOMOC_EXECUTABLE" "automoc" "" ### uic "AUTOUIC" "OFF" "" "AUTOUIC_OPTIONS" "-v" "" "AUTOUIC_SEARCH_PATHS" "${dir}" "" "AUTOUIC_EXECUTABLE" "autouic" "" ### rcc "AUTORCC" "OFF" "" "AUTORCC_OPTIONS" "-v" "" "AUTORCC_EXECUTABLE" "autorcc" "" # Linking properties "LINK_SEARCH_START_STATIC" "-Bstatic" "" "LINK_SEARCH_END_STATIC" "-Bdynamic" "" ## Dependent library lookup "MACOSX_RPATH" "@loader_path/" "" ### Build "BUILD_RPATH" "../lib" "" "BUILD_RPATH_USE_ORIGIN" "ON" "" "SKIP_BUILD_RPATH" "ON" "" "BUILD_WITH_INSTALL_RPATH" "ON" "" "BUILD_WITH_INSTALL_NAME_DIR" "@rpath/" "" ### Install "INSTALL_NAME_DIR" "@rpath/" "" "INSTALL_REMOVE_ENVIRONMENT_RPATH" "ON" "" "INSTALL_RPATH" "@rpath/" "" "INSTALL_RPATH_USE_LINK_PATH" "ON" "" ## Platforms ### Android "ANDROID_JAR_DIRECTORIES" "${dir}" "" "ANDROID_JAR_DEPENDENCIES" "${dir}/foo.jar" "" "ANDROID_NATIVE_LIB_DIRECTORIES" "${dir}" "" "ANDROID_NATIVE_LIB_DEPENDENCIES" "${dir}/native.a" "" "ANDROID_PROGUARD" "ON" "" "ANDROID_PROGUARD_CONFIG_PATH" "proguard.props" "" "ANDROID_SECURE_PROPS_PATH" "secure.props" "" ### iOS "IOS_INSTALL_COMBINED" "ON" "" ### Windows "GNUtoMS" "ON" "" "WIN32_EXECUTABLE" "OFF" "" ## Languages ### C "C_LINKER_LAUNCHER" "ccache" "" ### C++ "CXX_LINKER_LAUNCHER" "ccache" "" ### CUDA "CUDA_RESOLVE_DEVICE_SYMBOLS" "ON" "" "CUDA_RUNTIME_LIBRARY" "Static" "" ### HIP "HIP_RUNTIME_LIBRARY" "SHARED" "" ### Objective C "OBJC_LINKER_LAUNCHER" "ccache" "" ### Objective C++ "OBJCXX_LINKER_LAUNCHER" "ccache" "" # Static analysis ## C "C_CLANG_TIDY" "clang-tidy" "" "C_CLANG_TIDY_EXPORT_FIXES_DIR" "${dir}" "" "C_CPPLINT" "cpplint" "" "C_CPPCHECK" "cppcheck" "" "C_INCLUDE_WHAT_YOU_USE" "iwyu" "" ## C++ "CXX_CLANG_TIDY" "clang-tidy" "" "CXX_CLANG_TIDY_EXPORT_FIXES_DIR" "${dir}" "" "CXX_CPPLINT" "cpplint" "" "CXX_CPPCHECK" "cppcheck" "" "CXX_INCLUDE_WHAT_YOU_USE" "iwyu" "" ## Objective C "OBJC_CLANG_TIDY" "clang-tidy" "" "OBJC_CLANG_TIDY_EXPORT_FIXES_DIR" "${dir}" "" ## Objective C++ "OBJCXX_CLANG_TIDY" "clang-tidy" "" "OBJCXX_CLANG_TIDY_EXPORT_FIXES_DIR" "${dir}" "" ## Linking "LINK_WHAT_YOU_USE" "lwyu" "" # Build graph properties "LINK_DEPENDS_NO_SHARED" "OFF" "" "UNITY_BUILD" "OFF" "" "UNITY_BUILD_UNIQUE_ID" "unity" "" "UNITY_BUILD_BATCH_SIZE" "10" "" "UNITY_BUILD_MODE" "GROUP" "" "OPTIMIZE_DEPENDENCIES" "ON" "" ## Android "ANDROID_ANT_ADDITIONAL_OPTIONS" "-v" "" "ANDROID_PROCESS_MAX" "2" "" "ANDROID_SKIP_ANT_STEP" "ON" "" ## Autogen "AUTOGEN_ORIGIN_DEPENDS" "OFF" "" "AUTOGEN_PARALLEL" "ON" "" "AUTOGEN_USE_SYSTEM_INCLUDE" "ON" "" ## moc "AUTOMOC_DEPEND_FILTERS" "FIRSTSECOND" "" ## C++ "CXX_SCAN_FOR_MODULES" "ON" "" ## Ninja "JOB_POOL_COMPILE" "compile_pool" "" "JOB_POOL_LINK" "link_pool" "" "JOB_POOL_PRECOMPILE_HEADER" "pch_pool" "" ## Visual Studio "VS_NO_COMPILE_BATCHING" "ON" "" "VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION" "10.0.10240.0" "" # Output location properties "ARCHIVE_OUTPUT_DIRECTORY" "${dir}" "" "COMPILE_PDB_OUTPUT_DIRECTORY" "${dir}" "" "LIBRARY_OUTPUT_DIRECTORY" "${dir}" "" "PDB_OUTPUT_DIRECTORY" "${dir}" "" "RUNTIME_OUTPUT_DIRECTORY" "${dir}" "" # macOS bundle properties "FRAMEWORK" "OFF" "" "FRAMEWORK_MULTI_CONFIG_POSTFIX" ".mcpostfix" "" "MACOSX_BUNDLE" "OFF" "" # Usage requirement properties "LINK_INTERFACE_LIBRARIES" "c" "" # Metadata "EXPORT_COMPILE_COMMANDS" "OFF" "" ) if (CMAKE_HOST_APPLE) # compile-guarded in CMake if (CMAKE_GENERATOR STREQUAL "Xcode") list(APPEND properties # property expected alias # Xcode properties "XCODE_SCHEME_ADDRESS_SANITIZER" "ON" "" "XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN" "ON" "" "XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING" "ON" "" "XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE" "ON" "" "XCODE_SCHEME_THREAD_SANITIZER" "ON" "" "XCODE_SCHEME_THREAD_SANITIZER_STOP" "ON" "" "XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER" "ON" "" "XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP" "ON" "" "XCODE_SCHEME_LAUNCH_CONFIGURATION" "ON" "" "XCODE_SCHEME_ENABLE_GPU_API_VALIDATION" "ON" "" "XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION" "ON" "" "XCODE_SCHEME_WORKING_DIRECTORY" "ON" "" "XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER" "ON" "" "XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP" "ON" "" "XCODE_SCHEME_MALLOC_SCRIBBLE" "ON" "" "XCODE_SCHEME_MALLOC_GUARD_EDGES" "ON" "" "XCODE_SCHEME_GUARD_MALLOC" "ON" "" "XCODE_SCHEME_LAUNCH_MODE" "ON" "" "XCODE_SCHEME_ZOMBIE_OBJECTS" "ON" "" "XCODE_SCHEME_MALLOC_STACK" "ON" "" "XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE" "ON" "" "XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS" "ON" "" "XCODE_SCHEME_ENVIRONMENT" "ON" "" "XCODE_LINK_BUILD_PHASE_MODE" "BUILT_ONLY" "" ) endif () endif () macro (add_language_properties lang std) list(APPEND properties # property expected alias "${lang}_COMPILER_LAUNCHER" "ccache" "" "${lang}_STANDARD" "${std}" "" "${lang}_STANDARD_REQUIRED" "TRUE" "" "${lang}_EXTENSIONS" "FALSE" "" "${lang}_VISIBILITY_PRESET" "hidden" "" ) endmacro () # Mock up knowing the standard flag. This doesn't actually build, so nothing # should care at this point. set(CMAKE_Cc_std_11_STANDARD_COMPILE_OPTION "-std=c11") add_language_properties(C c_std_11) add_language_properties(CXX cxx_std_11) add_language_properties(CUDA cuda_std_11) add_language_properties(HIP hip_std_11) add_language_properties(OBJC c_std_99) add_language_properties(OBJCXX cxx_std_11) # Set up pools for properties set above. if (CMAKE_GENERATOR MATCHES "Ninja") set_property(GLOBAL APPEND PROPERTY JOB_POOLS compile_pool=1 link_pool=1 pch_pool=1) endif () prepare_target_types(can_compile_sources EXECUTABLE SHARED STATIC MODULE OBJECT) run_property_tests(can_compile_sources properties) set(properties_with_defaults # property expected alias "PCH_WARN_INVALID" "ON" "" "PCH_INSTANTIATE_TEMPLATES" "ON" "" "ISPC_HEADER_SUFFIX" "_ispc.h" "" "SKIP_BUILD_RPATH" "OFF" "" "BUILD_WITH_INSTALL_RPATH" "OFF" "" "INSTALL_RPATH" "" "" "INSTALL_RPATH_USE_LINK_PATH" "OFF" "" "UNITY_BUILD_BATCH_SIZE" "8" "" "UNITY_BUILD_MODE" "BATCH" "" ) if (CMAKE_HOST_APPLE) if (CMAKE_GENERATOR STREQUAL "Xcode") list(APPEND properties_with_defaults # property expected alias "XCODE_LINK_BUILD_PHASE_MODE" "NONE" "" ) endif () endif () set(with_defaults 1) run_property_tests(can_compile_sources properties_with_defaults)