From f44ecaa4f27e7538ddcad66d40e543bffa2d2d86 Mon Sep 17 00:00:00 2001 From: manuel Date: Sun, 4 Jun 2017 16:57:49 +0200 Subject: sync with upstream --- project/cmake/scripts/windows/ArchSetup.cmake | 89 ---------------------- project/cmake/scripts/windows/CFlagOverrides.cmake | 5 -- .../cmake/scripts/windows/CXXFlagOverrides.cmake | 5 -- project/cmake/scripts/windows/Install.cmake | 0 project/cmake/scripts/windows/Macros.cmake | 66 ---------------- project/cmake/scripts/windows/PathSetup.cmake | 34 --------- project/cmake/scripts/windows/tools/patch.cmake | 37 --------- 7 files changed, 236 deletions(-) delete mode 100644 project/cmake/scripts/windows/ArchSetup.cmake delete mode 100644 project/cmake/scripts/windows/CFlagOverrides.cmake delete mode 100644 project/cmake/scripts/windows/CXXFlagOverrides.cmake delete mode 100644 project/cmake/scripts/windows/Install.cmake delete mode 100644 project/cmake/scripts/windows/Macros.cmake delete mode 100644 project/cmake/scripts/windows/PathSetup.cmake delete mode 100644 project/cmake/scripts/windows/tools/patch.cmake (limited to 'project/cmake/scripts/windows') diff --git a/project/cmake/scripts/windows/ArchSetup.cmake b/project/cmake/scripts/windows/ArchSetup.cmake deleted file mode 100644 index 431b641..0000000 --- a/project/cmake/scripts/windows/ArchSetup.cmake +++ /dev/null @@ -1,89 +0,0 @@ -# -------- Architecture settings --------- - -set(ARCH win32) - - -# -------- Paths (mainly for find_package) --------- - -set(PLATFORM_DIR platform/win32) - -# Precompiled headers fail with per target output directory. (needs CMake 3.1) -set(PRECOMPILEDHEADER_DIR ${PROJECT_BINARY_DIR}/${CORE_BUILD_CONFIG}/objs) - -set(CMAKE_SYSTEM_NAME Windows) -list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${PROJECT_SOURCE_DIR}/../../lib/win32) -list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${PROJECT_SOURCE_DIR}/../../lib/win32/ffmpeg) -list(APPEND CMAKE_SYSTEM_LIBRARY_PATH ${PROJECT_SOURCE_DIR}/../../lib/win32/ffmpeg/bin) -list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${PROJECT_SOURCE_DIR}/../BuildDependencies) - -set(PYTHON_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/../BuildDependencies/include/python) - - -# -------- Compiler options --------- - -add_options(CXX ALL_BUILDS "/wd\"4996\"") -set(ARCH_DEFINES -D_WINDOWS -DTARGET_WINDOWS) -set(SYSTEM_DEFINES -DNOMINMAX -D_USE_32BIT_TIME_T -DHAS_DX -D__STDC_CONSTANT_MACROS - -DTAGLIB_STATIC -DNPT_CONFIG_ENABLE_LOGGING - -DPLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNADOC/1.50 Kodi" - -DPLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi" - $<$:-DD3D_DEBUG_INFO -D_ITERATOR_DEBUG_LEVEL=0>) - -# Make sure /FS is set for Visual Studio in order to prevent simultanious access to pdb files. -if(CMAKE_GENERATOR MATCHES "Visual Studio") - set(CMAKE_CXX_FLAGS "/MP /FS ${CMAKE_CXX_FLAGS}") -endif() - -# Google Test needs to use shared version of runtime libraries -set(gtest_force_shared_crt ON CACHE STRING "" FORCE) - - -# -------- Linker options --------- - -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") - -# For #pragma comment(lib X) -# TODO: It would certainly be better to handle these libraries via CMake modules. -link_directories(${PROJECT_SOURCE_DIR}/../../lib/win32/ffmpeg/bin - ${PROJECT_SOURCE_DIR}/../BuildDependencies/lib) - -# Additional libraries -list(APPEND DEPLIBS d3d11.lib DInput8.lib DSound.lib winmm.lib Mpr.lib Iphlpapi.lib - PowrProf.lib setupapi.lib dwmapi.lib yajl.lib dxguid.lib DelayImp.lib) - -# NODEFAULTLIB option -set(_nodefaultlibs_RELEASE libcmt) -set(_nodefaultlibs_DEBUG libcmt msvcrt) -foreach(_lib ${_nodefaultlibs_RELEASE}) - set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:\"${_lib}\"") -endforeach() -foreach(_lib ${_nodefaultlibs_DEBUG}) - set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:\"${_lib}\"") -endforeach() - -# DELAYLOAD option -set(_delayloadlibs zlib.dll libmysql.dll libxslt.dll dnssd.dll dwmapi.dll ssh.dll sqlite3.dll - avcodec-57.dll avfilter-6.dll avformat-57.dll avutil-55.dll - postproc-54.dll swresample-2.dll swscale-4.dll d3dcompiler_47.dll) -foreach(_lib ${_delayloadlibs}) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DELAYLOAD:\"${_lib}\"") -endforeach() - -# Make the Release version create a PDB -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi") -# Minimize the size or the resulting DLLs -set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF") - - -# -------- Visual Studio options --------- - -if(CMAKE_GENERATOR MATCHES "Visual Studio") - set_property(GLOBAL PROPERTY USE_FOLDERS ON) - - # Generate a batch file that opens Visual Studio with the necessary env variables set. - file(WRITE ${CMAKE_BINARY_DIR}/kodi-sln.bat - "@echo off\n" - "set KODI_HOME=%~dp0\n" - "set PATH=%~dp0\\system\n" - "start %~dp0\\${PROJECT_NAME}.sln") -endif() diff --git a/project/cmake/scripts/windows/CFlagOverrides.cmake b/project/cmake/scripts/windows/CFlagOverrides.cmake deleted file mode 100644 index 3158e75..0000000 --- a/project/cmake/scripts/windows/CFlagOverrides.cmake +++ /dev/null @@ -1,5 +0,0 @@ -if(MSVC) - set(CMAKE_C_FLAGS_INIT "/MP /DWIN32 /D_WINDOWS /W3 /Zi /arch:SSE2") - set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Ob0 /Od /RTC1 /D_ITERATOR_DEBUG_LEVEL=0") - set(CMAKE_C_FLAGS_RELEASE_INIT "/MD /Ox /Ob2 /Oi /Ot /Oy /GL /DNDEBUG") -endif() diff --git a/project/cmake/scripts/windows/CXXFlagOverrides.cmake b/project/cmake/scripts/windows/CXXFlagOverrides.cmake deleted file mode 100644 index 0b52dc6..0000000 --- a/project/cmake/scripts/windows/CXXFlagOverrides.cmake +++ /dev/null @@ -1,5 +0,0 @@ -if(MSVC) - set(CMAKE_CXX_FLAGS_INIT "/MP /DWIN32 /D_WINDOWS /W3 /GR /Zi /EHsc /arch:SSE2") - set(CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Ob0 /Od /RTC1 /D_ITERATOR_DEBUG_LEVEL=0") - set(CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /Ox /Ob2 /Oi /Ot /Oy /GL /DNDEBUG") -endif() diff --git a/project/cmake/scripts/windows/Install.cmake b/project/cmake/scripts/windows/Install.cmake deleted file mode 100644 index e69de29..0000000 diff --git a/project/cmake/scripts/windows/Macros.cmake b/project/cmake/scripts/windows/Macros.cmake deleted file mode 100644 index 2d3500d..0000000 --- a/project/cmake/scripts/windows/Macros.cmake +++ /dev/null @@ -1,66 +0,0 @@ -function(core_link_library lib wraplib) - message(AUTHOR_WARNING "core_link_library is not compatible with windows.") -endfunction() - -function(find_soname lib) - # Windows uses hardcoded dlls in xbmc/DllPaths_win32.h. - # Therefore the output of this function is unused. -endfunction() - -# Add precompiled header to target -# Arguments: -# target existing target that will be set up to compile with a precompiled header -# pch_header the precompiled header file -# pch_source the precompiled header source file -# Optional Arguments: -# PCH_TARGET build precompiled header as separate target with the given name -# so that the same precompiled header can be used for multiple libraries -# EXCLUDE_SOURCES if not all target sources shall use the precompiled header, -# the relevant files can be listed here -# On return: -# Compiles the pch_source into a precompiled header and adds the header to -# the given target -function(add_precompiled_header target pch_header pch_source) - cmake_parse_arguments(PCH "" "PCH_TARGET" "EXCLUDE_SOURCES" ${ARGN}) - - if(PCH_PCH_TARGET) - set(pch_binary ${PRECOMPILEDHEADER_DIR}/${PCH_PCH_TARGET}.pch) - else() - set(pch_binary ${PRECOMPILEDHEADER_DIR}/${target}.pch) - endif() - - # Set compile options and dependency for sources - get_target_property(sources ${target} SOURCES) - list(REMOVE_ITEM sources ${pch_source}) - foreach(exclude_source IN LISTS PCH_EXCLUDE_SOURCES) - list(REMOVE_ITEM sources ${exclude_source}) - endforeach() - set_source_files_properties(${sources} - PROPERTIES COMPILE_FLAGS "/Yu\"${pch_header}\" /Fp\"${pch_binary}\" /FI\"${pch_header}\"" - OBJECT_DEPENDS "${pch_binary}") - - # Set compile options for precompiled header - if(NOT PCH_PCH_TARGET OR NOT TARGET ${PCH_PCH_TARGET}_pch) - set_source_files_properties(${pch_source} - PROPERTIES COMPILE_FLAGS "/Yc\"${pch_header}\" /Fp\"${pch_binary}\"" - OBJECT_OUTPUTS "${pch_binary}") - endif() - - # Compile precompiled header - if(PCH_PCH_TARGET) - # As own target for usage in multiple libraries - if(NOT TARGET ${PCH_PCH_TARGET}_pch) - add_library(${PCH_PCH_TARGET}_pch STATIC ${pch_source}) - set_target_properties(${PCH_PCH_TARGET}_pch PROPERTIES COMPILE_PDB_NAME vc140 - COMPILE_PDB_OUTPUT_DIRECTORY ${PRECOMPILEDHEADER_DIR} - FOLDER "Build Utilities") - endif() - # From VS2012 onwards, precompiled headers have to be linked against (LNK2011). - target_link_libraries(${target} PUBLIC ${PCH_PCH_TARGET}_pch) - set_target_properties(${target} PROPERTIES COMPILE_PDB_NAME vc140 - COMPILE_PDB_OUTPUT_DIRECTORY ${PRECOMPILEDHEADER_DIR}) - else() - # As part of the target - target_sources(${target} PRIVATE ${pch_source}) - endif() -endfunction() diff --git a/project/cmake/scripts/windows/PathSetup.cmake b/project/cmake/scripts/windows/PathSetup.cmake deleted file mode 100644 index 8550616..0000000 --- a/project/cmake/scripts/windows/PathSetup.cmake +++ /dev/null @@ -1,34 +0,0 @@ -if(NOT prefix) - set(prefix ${CMAKE_INSTALL_PREFIX}) -else() - set(CMAKE_INSTALL_PREFIX ${prefix}) -endif() -if(NOT exec_prefix) - set(exec_prefix ${prefix}) -endif() -if(NOT libdir) - set(libdir ${prefix}/lib) -endif() -if(NOT bindir) - set(bindir ${prefix}/bin) -endif() -if(NOT includedir) - set(includedir ${prefix}/include) -endif() -if(NOT datarootdir) - set(datarootdir ${prefix}/share) -endif() -if(NOT datadir) - set(datadir ${datarootdir}) -endif() - -list(APPEND final_message "-- PATH config --") -list(APPEND final_message "Prefix: ${prefix}") -list(APPEND final_message "Libdir: ${libdir}") -list(APPEND final_message "Bindir: ${bindir}") -list(APPEND final_message "Includedir: ${includedir}") -list(APPEND final_message "Datarootdir: ${datarootdir}") -list(APPEND final_message "Datadir: ${datadir}") - -set(PATH_DEFINES -DBIN_INSTALL_PATH=\"${libdir}/kodi\" - -DINSTALL_PATH=\"${datarootdir}/kodi\") diff --git a/project/cmake/scripts/windows/tools/patch.cmake b/project/cmake/scripts/windows/tools/patch.cmake deleted file mode 100644 index 0ef2952..0000000 --- a/project/cmake/scripts/windows/tools/patch.cmake +++ /dev/null @@ -1,37 +0,0 @@ -find_program(PATCH_FOUND NAMES patch patch.exe) -if(PATCH_FOUND) - message(STATUS "patch utility found at ${PATCH_FOUND}") -else() - set(PATCH_ARCHIVE_NAME "patch-2.5.9-7-bin-1") - set(PATCH_ARCHIVE "${PATCH_ARCHIVE_NAME}.zip") - set(PATCH_URL "${KODI_MIRROR}/build-deps/win32/${PATCH_ARCHIVE}") - set(PATCH_DOWNLOAD ${BUILD_DIR}/download/${PATCH_ARCHIVE}) - - # download the archive containing patch.exe - message(STATUS "Downloading patch utility from ${PATCH_URL}...") - file(DOWNLOAD "${PATCH_URL}" "${PATCH_DOWNLOAD}" STATUS PATCH_DL_STATUS LOG PATCH_LOG SHOW_PROGRESS) - list(GET PATCH_DL_STATUS 0 PATCH_RETCODE) - if(NOT PATCH_RETCODE EQUAL 0) - message(FATAL_ERROR "ERROR downloading ${PATCH_URL} - status: ${PATCH_DL_STATUS} log: ${PATCH_LOG}") - endif() - - # extract the archive containing patch.exe - execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzvf ${PATCH_DOWNLOAD} - WORKING_DIRECTORY ${BUILD_DIR}) - - # make sure the extraction worked and that patch.exe is there - set(PATCH_PATH ${BUILD_DIR}/${PATCH_ARCHIVE_NAME}) - set(PATCH_BINARY_PATH ${PATCH_PATH}/bin/patch.exe) - if(NOT EXISTS ${PATCH_PATH} OR NOT EXISTS ${PATCH_BINARY_PATH}) - message(FATAL_ERROR "ERROR extracting patch utility from ${PATCH_PATH}") - endif() - - # copy patch.exe into the output directory - file(INSTALL ${PATCH_BINARY_PATH} DESTINATION ${ADDON_DEPENDS_PATH}/bin) - - # make sure that cmake can find the copied patch.exe - find_program(PATCH_FOUND NAMES patch patch.exe) - if(NOT PATCH_FOUND) - message(FATAL_ERROR "ERROR installing patch utility from ${PATCH_BINARY_PATH} to ${ADDON_DEPENDS_PATH}/bin") - endif() -endif() -- cgit v1.2.3