Skip to content

Commit

Permalink
Revise platform support and linkage
Browse files Browse the repository at this point in the history
  • Loading branch information
dg0yt committed Sep 25, 2022
1 parent 7ec0f9c commit aa62ef5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
16 changes: 9 additions & 7 deletions ports/ogre/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ if(NOT VCPKG_TARGET_IS_WINDOWS)
message("${PORT} currently requires the following library from the system package manager:\n Xaw\n\nIt can be installed on Ubuntu systems via apt-get install libxaw7-dev")
endif()

if(VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_IOS OR VCPKG_TARGET_IS_EMSCRIPTEN)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO OGRECave/ogre
Expand All @@ -21,13 +25,7 @@ vcpkg_from_github(

file(REMOVE "${SOURCE_PATH}/CMake/Packages/FindOpenEXR.cmake")

if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
set(OGRE_STATIC ON)
else()
set(OGRE_STATIC OFF)
endif()

# Configure features
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" OGRE_STATIC)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
Expand All @@ -37,10 +35,14 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
freeimage OGRE_BUILD_PLUGIN_FREEIMAGE
freeimage CMAKE_REQUIRE_FIND_PACKAGE_FreeImage
java OGRE_BUILD_COMPONENT_JAVA
java CMAKE_REQUIRE_FIND_PACKAGE_SWIG
openexr OGRE_BUILD_PLUGIN_EXRCODEC
openexr CMAKE_REQUIRE_FIND_PACKAGE_OpenEXR
python OGRE_BUILD_COMPONENT_PYTHON
python CMAKE_REQUIRE_FIND_PACKAGE_Python3
python CMAKE_REQUIRE_FIND_PACKAGE_SWIG
csharp OGRE_BUILD_COMPONENT_CSHARP
csharp CMAKE_REQUIRE_FIND_PACKAGE_SWIG
overlay OGRE_BUILD_COMPONENT_OVERLAY
overlay CMAKE_REQUIRE_FIND_PACKAGE_FREETYPE
zziplib OGRE_CONFIG_ENABLE_ZIP
Expand Down
20 changes: 14 additions & 6 deletions ports/ogre/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"license": "MIT",
"dependencies": [
"pugixml",
"sdl2",
{
"name": "sdl2",
"platform": "!android"
},
{
"name": "vcpkg-cmake",
"host": true
Expand All @@ -32,19 +35,22 @@
]
},
"csharp": {
"description": "Build csharp bindings"
"description": "Build csharp bindings",
"supports": "!static & !android & !ios & !emscripten"
},
"d3d9": {
"description": "Build Direct3D9 RenderSystem"
"description": "Build Direct3D9 RenderSystem",
"supports": "windows"
},
"freeimage": {
"description": "Build with FreeImage support",
"description": "Build with FreeImage support (no effect for Emscripten)",
"dependencies": [
"freeimage"
]
},
"java": {
"description": "Build Java (JNI) bindings"
"description": "Build Java (JNI) bindings",
"supports": "!static & !android & !ios & !emscripten"
},
"openexr": {
"description": "Build with OpenEXR support",
Expand All @@ -69,6 +75,7 @@
},
"python": {
"description": "Build Python bindings",
"supports": "!static & !android & !ios & !emscripten",
"dependencies": [
"python3"
]
Expand All @@ -77,7 +84,8 @@
"description": "Force Ogre resource manager to be strict with group names and resource names"
},
"tools": {
"description": "Build tools"
"description": "Build tools",
"supports": "!android & !emscripten"
},
"zziplib": {
"description": "Build with zziplib support",
Expand Down

0 comments on commit aa62ef5

Please sign in to comment.