diff options
author | fuzzard <fuzzard@users.noreply.github.com> | 2023-06-23 10:12:03 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-23 10:12:03 +1000 |
commit | 1bb5fee9f7a055da34e7047414707b3c29e9fcb3 (patch) | |
tree | 2a8a563fc2fec587c971bd121998fa2f2d0d23a4 | |
parent | 031a53d5e6603f194c64fdb3c7323086656abb17 (diff) | |
parent | 0a8e90d9e018a4605bb23247088184e154b6d7c4 (diff) |
Merge pull request #23419 from fuzzard/cmake_jsonschemabuilderupdate
Build jsonschemabuilder for all platforms from source
-rw-r--r-- | cmake/modules/buildtools/FindJsonSchemaBuilder.cmake | 93 | ||||
-rw-r--r-- | cmake/scripts/common/ModuleHelpers.cmake | 6 | ||||
-rw-r--r-- | project/BuildDependencies/scripts/0_package.native-win32.list | 1 | ||||
-rw-r--r-- | tools/depends/native/JsonSchemaBuilder/Makefile | 23 | ||||
-rw-r--r-- | tools/depends/native/JsonSchemaBuilder/src/CMakeLists.txt (renamed from tools/depends/native/JsonSchemaBuilder/CMakeLists.txt) | 5 | ||||
-rw-r--r-- | tools/depends/native/JsonSchemaBuilder/src/LICENSE.GPL (renamed from tools/depends/native/JsonSchemaBuilder/LICENSE.GPL) | 0 | ||||
-rw-r--r-- | tools/depends/native/JsonSchemaBuilder/src/README (renamed from tools/depends/native/JsonSchemaBuilder/README) | 0 | ||||
-rw-r--r-- | tools/depends/native/JsonSchemaBuilder/win32/JsonSchemaBuilder.sln | 20 | ||||
-rw-r--r-- | tools/depends/native/JsonSchemaBuilder/win32/JsonSchemaBuilder.vcxproj | 85 | ||||
-rw-r--r-- | tools/depends/native/JsonSchemaBuilder/win32/JsonSchemaBuilder.vcxproj.filters | 13 | ||||
-rw-r--r-- | tools/depends/native/Makefile | 3 |
11 files changed, 79 insertions, 170 deletions
diff --git a/cmake/modules/buildtools/FindJsonSchemaBuilder.cmake b/cmake/modules/buildtools/FindJsonSchemaBuilder.cmake index a39fec755c..0b7b56481d 100644 --- a/cmake/modules/buildtools/FindJsonSchemaBuilder.cmake +++ b/cmake/modules/buildtools/FindJsonSchemaBuilder.cmake @@ -12,42 +12,77 @@ # JsonSchemaBuilder::JsonSchemaBuilder - The JsonSchemaBuilder executable if(NOT TARGET JsonSchemaBuilder::JsonSchemaBuilder) - if(KODI_DEPENDSBUILD) - get_filename_component(_jsbpath "${NATIVEPREFIX}/bin" ABSOLUTE) - find_program(JSONSCHEMABUILDER_EXECUTABLE NAMES "${APP_NAME_LC}-JsonSchemaBuilder" JsonSchemaBuilder - HINTS ${_jsbpath}) - add_executable(JsonSchemaBuilder::JsonSchemaBuilder IMPORTED GLOBAL) - set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES - IMPORTED_LOCATION "${JSONSCHEMABUILDER_EXECUTABLE}") - elseif(CORE_SYSTEM_NAME STREQUAL windowsstore) - get_filename_component(_jsbpath "${NATIVEPREFIX}/bin/json-rpc" ABSOLUTE) + include(cmake/scripts/common/ModuleHelpers.cmake) + + if(WITH_JSONSCHEMABUILDER) + get_filename_component(_jsbpath ${WITH_JSONSCHEMABUILDER} ABSOLUTE) + get_filename_component(_jsbpath ${_jsbpath} DIRECTORY) find_program(JSONSCHEMABUILDER_EXECUTABLE NAMES "${APP_NAME_LC}-JsonSchemaBuilder" JsonSchemaBuilder + "${APP_NAME_LC}-JsonSchemaBuilder.exe" JsonSchemaBuilder.exe HINTS ${_jsbpath}) + if(NOT JSONSCHEMABUILDER_EXECUTABLE) + message(FATAL_ERROR "Could not find 'JsonSchemaBuilder' executable in ${_jsbpath} supplied by -DWITH_JSONSCHEMABUILDER") + endif() + else() + + set(MODULE_LC JsonSchemaBuilder) + set(LIB_TYPE native) + set(JSONSCHEMABUILDER_DISABLE_VERSION ON) + SETUP_BUILD_VARS() + + # Override build type detection and always build as release + set(JSONSCHEMABUILDER_BUILD_TYPE Release) + + set(CMAKE_ARGS -DDUMMY_ARG=1) + + if(NATIVEPREFIX) + set(INSTALL_DIR "${NATIVEPREFIX}/bin") + set(JSONSCHEMABUILDER_INSTALL_PREFIX ${NATIVEPREFIX}) + else() + set(INSTALL_DIR "${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/bin") + set(JSONSCHEMABUILDER_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}) + endif() + + # Set host build info for buildtool + if(EXISTS "${NATIVEPREFIX}/share/Toolchain-Native.cmake") + set(JSONSCHEMABUILDER_TOOLCHAIN_FILE "${NATIVEPREFIX}/share/Toolchain-Native.cmake") + endif() + + if(WIN32 OR WINDOWS_STORE) + # Make sure we generate for host arch, not target + set(JSONSCHEMABUILDER_GENERATOR_PLATFORM CMAKE_GENERATOR_PLATFORM WIN32) + set(WIN_DISABLE_PROJECT_FLAGS 1) + set(APP_EXTENSION ".exe") + endif() + + set(JSONSCHEMABUILDER_SOURCE_DIR ${CMAKE_SOURCE_DIR}/tools/depends/native/JsonSchemaBuilder/src) + set(JSONSCHEMABUILDER_EXECUTABLE ${INSTALL_DIR}/JsonSchemaBuilder${APP_EXTENSION}) + + set(BUILD_BYPRODUCTS ${JSONSCHEMABUILDER_EXECUTABLE}) + + BUILD_DEP_TARGET() + + endif() + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(JsonSchemaBuilder + REQUIRED_VARS JSONSCHEMABUILDER_EXECUTABLE) + + if(JSONSCHEMABUILDER_FOUND) add_executable(JsonSchemaBuilder::JsonSchemaBuilder IMPORTED GLOBAL) set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES - IMPORTED_LOCATION "${JSONSCHEMABUILDER_EXECUTABLE}") + IMPORTED_LOCATION "${JSONSCHEMABUILDER_EXECUTABLE}") + + if(TARGET JsonSchemaBuilder) + add_dependencies(JsonSchemaBuilder::JsonSchemaBuilder JsonSchemaBuilder) + endif() else() - if(WITH_JSONSCHEMABUILDER) - get_filename_component(_jsbpath ${WITH_JSONSCHEMABUILDER} ABSOLUTE) - get_filename_component(_jsbpath ${_jsbpath} DIRECTORY) - find_program(JSONSCHEMABUILDER_EXECUTABLE NAMES "${APP_NAME_LC}-JsonSchemaBuilder" JsonSchemaBuilder - HINTS ${_jsbpath}) - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(JsonSchemaBuilder "Could not find '${APP_NAME_LC}-JsonSchemaBuilder' or 'JsonSchemaBuilder' executable in ${_jsbpath} supplied by -DWITH_JSONSCHEMABUILDER. Make sure the executable file name matches these names!" - JSONSCHEMABUILDER_EXECUTABLE) - if(JSONSCHEMABUILDER_FOUND) - add_executable(JsonSchemaBuilder::JsonSchemaBuilder IMPORTED GLOBAL) - set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES - IMPORTED_LOCATION "${JSONSCHEMABUILDER_EXECUTABLE}") - endif() - mark_as_advanced(JSONSCHEMABUILDER) - else() - add_subdirectory(${CMAKE_SOURCE_DIR}/tools/depends/native/JsonSchemaBuilder build/jsonschemabuilder) - add_executable(JsonSchemaBuilder::JsonSchemaBuilder ALIAS JsonSchemaBuilder) - set_target_properties(JsonSchemaBuilder PROPERTIES FOLDER Tools) + if(JSONSCHEMABUILDER_FIND_REQUIRED) + message(FATAL_ERROR "JsonSchemaBuilder not found.") endif() endif() + + mark_as_advanced(JSONSCHEMABUILDER_EXECUTABLE) endif() diff --git a/cmake/scripts/common/ModuleHelpers.cmake b/cmake/scripts/common/ModuleHelpers.cmake index 7365c914ee..d38e5afe7c 100644 --- a/cmake/scripts/common/ModuleHelpers.cmake +++ b/cmake/scripts/common/ModuleHelpers.cmake @@ -141,8 +141,10 @@ macro(SETUP_BUILD_VARS) set(PROJECTSOURCE ${CMAKE_SOURCE_DIR}) endif() - # populate variables of data from VERSION file for MODULE - get_versionfile_data() + if(NOT ${MODULE}_DISABLE_VERSION) + # populate variables of data from VERSION file for MODULE + get_versionfile_data() + endif() # allow user to override the download URL with a local tarball # needed for offline build envs diff --git a/project/BuildDependencies/scripts/0_package.native-win32.list b/project/BuildDependencies/scripts/0_package.native-win32.list index e97f37a878..0e7c6d6700 100644 --- a/project/BuildDependencies/scripts/0_package.native-win32.list +++ b/project/BuildDependencies/scripts/0_package.native-win32.list @@ -6,6 +6,5 @@ ; -> sqlite-3.7.12.1-win32\system\sqlite3.dll ; -> ... ;PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER! -JsonSchemaBuilder-win32-v141-20200105.7z swig-4.0.1-win32-v141-20200105.7z TexturePacker-win32-v141-20200105.7z diff --git a/tools/depends/native/JsonSchemaBuilder/Makefile b/tools/depends/native/JsonSchemaBuilder/Makefile index e01a035616..e0d0dd4877 100644 --- a/tools/depends/native/JsonSchemaBuilder/Makefile +++ b/tools/depends/native/JsonSchemaBuilder/Makefile @@ -1,37 +1,28 @@ -ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) include ../../Makefile.include PREFIX=$(NATIVEPREFIX) PLATFORM=$(NATIVEPLATFORM) DEPS =../../Makefile.include Makefile -SOURCE=$(ROOT_DIR)/src - -CONFIGURE=./configure --prefix=$(PREFIX) -APP=$(PLATFORM)/JsonSchemaBuilder -APPBIN=$(PREFIX)/bin/JsonSchemaBuilder +APP=$(PLATFORM)/build/JsonSchemaBuilder all: .installed-$(PLATFORM) download: $(PLATFORM): $(DEPS) - -rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM) - cd $(PLATFORM); cp -a $(SOURCE)/* . - cd $(PLATFORM); ./autogen.sh - cd $(PLATFORM); $(CONFIGURE) - + -rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM)/build + cd $(PLATFORM); cp -a ../src/* . + cd $(PLATFORM)/build; $(CMAKE_FOR_BUILD) .. $(APP): $(PLATFORM) - $(MAKE) -C $(PLATFORM) - + $(MAKE) -C $(PLATFORM)/build .installed-$(PLATFORM): $(APP) - $(MAKE) -C $(PLATFORM) install + $(MAKE) -C $(PLATFORM)/build install touch $@ clean: - $(MAKE) -C $(PLATFORM) clean + $(MAKE) -C $(PLATFORM)/build clean distclean:: rm -rf $(PLATFORM) .installed-$(PLATFORM) - -rm -rf bin diff --git a/tools/depends/native/JsonSchemaBuilder/CMakeLists.txt b/tools/depends/native/JsonSchemaBuilder/src/CMakeLists.txt index e1c6c210bb..e298d91c34 100644 --- a/tools/depends/native/JsonSchemaBuilder/CMakeLists.txt +++ b/tools/depends/native/JsonSchemaBuilder/src/CMakeLists.txt @@ -1,8 +1,9 @@ +cmake_minimum_required(VERSION 3.15) project(JsonSchemaBuilder) -set(SOURCES src/JsonSchemaBuilder.cpp) +set(SOURCES JsonSchemaBuilder.cpp) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) add_executable(JsonSchemaBuilder ${SOURCES}) diff --git a/tools/depends/native/JsonSchemaBuilder/LICENSE.GPL b/tools/depends/native/JsonSchemaBuilder/src/LICENSE.GPL index c7e8863573..c7e8863573 100644 --- a/tools/depends/native/JsonSchemaBuilder/LICENSE.GPL +++ b/tools/depends/native/JsonSchemaBuilder/src/LICENSE.GPL diff --git a/tools/depends/native/JsonSchemaBuilder/README b/tools/depends/native/JsonSchemaBuilder/src/README index f6fcb8ef4d..f6fcb8ef4d 100644 --- a/tools/depends/native/JsonSchemaBuilder/README +++ b/tools/depends/native/JsonSchemaBuilder/src/README diff --git a/tools/depends/native/JsonSchemaBuilder/win32/JsonSchemaBuilder.sln b/tools/depends/native/JsonSchemaBuilder/win32/JsonSchemaBuilder.sln deleted file mode 100644 index 33a71954de..0000000000 --- a/tools/depends/native/JsonSchemaBuilder/win32/JsonSchemaBuilder.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JsonSchemaBuilder", "JsonSchemaBuilder.vcxproj", "{6D4C9949-FF2B-4B14-83BB-D86AB27B855A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6D4C9949-FF2B-4B14-83BB-D86AB27B855A}.Debug|Win32.ActiveCfg = Debug|Win32 - {6D4C9949-FF2B-4B14-83BB-D86AB27B855A}.Debug|Win32.Build.0 = Debug|Win32 - {6D4C9949-FF2B-4B14-83BB-D86AB27B855A}.Release|Win32.ActiveCfg = Release|Win32 - {6D4C9949-FF2B-4B14-83BB-D86AB27B855A}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/tools/depends/native/JsonSchemaBuilder/win32/JsonSchemaBuilder.vcxproj b/tools/depends/native/JsonSchemaBuilder/win32/JsonSchemaBuilder.vcxproj deleted file mode 100644 index ab84c5cf9f..0000000000 --- a/tools/depends/native/JsonSchemaBuilder/win32/JsonSchemaBuilder.vcxproj +++ /dev/null @@ -1,85 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectGuid>{6D4C9949-FF2B-4B14-83BB-D86AB27B855A}</ProjectGuid> - <Keyword>Win32Proj</Keyword> - <RootNamespace>JsonSchemaBuilder</RootNamespace> - <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>true</UseDebugLibraries> - <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v141</PlatformToolset> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v141</PlatformToolset> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <LinkIncremental>true</LinkIncremental> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <LinkIncremental>false</LinkIncremental> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> - <WarningLevel>Level3</WarningLevel> - <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> - </ClCompile> - <Link> - <SubSystem>Console</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <WarningLevel>Level3</WarningLevel> - <PrecompiledHeader> - </PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> - </ClCompile> - <Link> - <SubSystem>Console</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - </Link> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="..\src\JsonSchemaBuilder.cpp" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project>
\ No newline at end of file diff --git a/tools/depends/native/JsonSchemaBuilder/win32/JsonSchemaBuilder.vcxproj.filters b/tools/depends/native/JsonSchemaBuilder/win32/JsonSchemaBuilder.vcxproj.filters deleted file mode 100644 index 3c090a861f..0000000000 --- a/tools/depends/native/JsonSchemaBuilder/win32/JsonSchemaBuilder.vcxproj.filters +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="src"> - <UniqueIdentifier>{7ce1989c-783c-4e53-bb32-8511e3adab08}</UniqueIdentifier> - </Filter> - </ItemGroup> - <ItemGroup> - <ClCompile Include="..\src\JsonSchemaBuilder.cpp"> - <Filter>src</Filter> - </ClCompile> - </ItemGroup> -</Project>
\ No newline at end of file diff --git a/tools/depends/native/Makefile b/tools/depends/native/Makefile index 28ce21e84e..d77b2512e6 100644 --- a/tools/depends/native/Makefile +++ b/tools/depends/native/Makefile @@ -14,7 +14,6 @@ NATIVE= \ gettext \ giflib \ heimdal \ - JsonSchemaBuilder \ libjpeg-turbo \ liblzo2 \ libpng \ @@ -68,7 +67,7 @@ autoconf: m4 automake: autoconf dpkg: automake gettext libtool pkg-config tar heimdal: libtool -JsonSchemaBuilder: automake +JsonSchemaBuilder: cmake libjpeg-turbo: cmake nasm libpng: zlib automake libtool: automake |