Skip to content

Commit

Permalink
Update VCPKG deprecations and fix compiler flags for bullet3 and opus…
Browse files Browse the repository at this point in the history
… being overwritten.

VCPKG sets CMAKE_CXX_FLAGS and CMAKE_C_FLAGS automatically; Apparently our code to set those flags has never worked and rather than ignoring most of it, it changed to putting it somewhere it doesn't belong.
  • Loading branch information
JulianGro committed Aug 15, 2022
1 parent 3b07b16 commit a6a889a
Show file tree
Hide file tree
Showing 30 changed files with 10 additions and 119 deletions.
1 change: 0 additions & 1 deletion cmake/ports/aristo/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include(vcpkg_common_functions)
set(ARISTO_VERSION 0.8.1)
set(MASTER_COPY_SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src)

Expand Down
35 changes: 4 additions & 31 deletions cmake/ports/bullet3/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm)
#

include(vcpkg_common_functions)


if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
message(WARNING "Dynamic not supported, building static")
Expand All @@ -31,40 +29,12 @@ vcpkg_from_github(
PATCHES "bullet-git-fix-build-clang-8.patch"
)

if(WIN32)
set(VIRCADIA_BULLET_OPTIONS "")
else()
if(EXISTS "${VCPKG_ROOT_DIR}/_env/VIRCADIA_OPTIMIZE.txt")
file(READ "${VCPKG_ROOT_DIR}/_env/VIRCADIA_OPTIMIZE.txt" VIRCADIA_OPTIMIZE)
endif()
if(EXISTS "${VCPKG_ROOT_DIR}/_env/VIRCADIA_CPU_ARCHITECTURE.txt")
file(READ "${VCPKG_ROOT_DIR}/_env/VIRCADIA_CPU_ARCHITECTURE.txt" VIRCADIA_CPU_ARCHITECTURE)
endif()


if(VIRCADIA_OPTIMIZE)
set(VIRCADIA_BULLET_OPTIONS "-DCMAKE_BUILD_TYPE=Release")
else()
set(VIRCADIA_BULLET_OPTIONS "-DCMAKE_BUILD_TYPE=RelWithDebInfo")
endif()

set(VIRCADIA_BULLET_OPTIONS "${VIRCADIA_BULLET_OPTIONS}")

if(DEFINED VIRCADIA_CPU_ARCHITECTURE)
set(VIRCADIA_BULLET_OPTIONS "${VIRCADIA_BULLET_OPTIONS} -DCMAKE_CXX_FLAGS=\"${VIRCADIA_CPU_ARCHITECTURE}\" -DCMAKE_C_FLAGS=\"${VIRCADIA_CPU_ARCHITECTURE}\" ")
endif()
endif()

message("Optimization options for Bullet: ${VIRCADIA_BULLET_OPTIONS}")

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON
-DUSE_MSVC_RUNTIME_LIBRARY_DLL=ON
-DUSE_GLUT=0
-DUSE_DX11=0
-DBUILD_DEMOS=OFF
-DBUILD_OPENGL3_DEMOS=OFF
-DBUILD_BULLET3=OFF
-DBUILD_BULLET2_DEMOS=OFF
Expand All @@ -73,7 +43,10 @@ vcpkg_configure_cmake(
-DBUILD_UNIT_TESTS=OFF
-DBUILD_SHARED_LIBS=ON
-DINSTALL_LIBS=ON
${VIRCADIA_BULLET_OPTIONS}
MAYBE_UNUSED_VARIABLES
-DBUILD_DEMOS=OFF
-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON
-DUSE_DX11=0
)

vcpkg_install_cmake()
Expand Down
2 changes: 0 additions & 2 deletions cmake/ports/draco/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
endif()

include(vcpkg_common_functions)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO vircadia/draco
Expand Down
2 changes: 0 additions & 2 deletions cmake/ports/etc2comp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(VCPKG_CRT_LINKAGE dynamic)
endif()

include(vcpkg_common_functions)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO vircadia/etc2comp
Expand Down
1 change: 0 additions & 1 deletion cmake/ports/glad/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include(vcpkg_common_functions)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

file(READ "${VCPKG_ROOT_DIR}/_env/EXTERNAL_BUILD_ASSETS.txt" EXTERNAL_BUILD_ASSETS)
Expand Down
1 change: 0 additions & 1 deletion cmake/ports/gli/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#header-only library
include(vcpkg_common_functions)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
Expand Down
8 changes: 1 addition & 7 deletions cmake/ports/glm/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
include(vcpkg_common_functions)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO g-truc/glm
REF 0.9.9.3
SHA512 44152ea6438763feda3b78813287fd59d3574a9630a41647a157825bf5ce4a18fbbecae5a5ccd94acc118ed3d42cbce53d3a67f25632d0c00ab77e7de2bb4650
HEAD_REF master
)

vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES "${CMAKE_CURRENT_LIST_DIR}/disable_warnings_as_error.patch"
PATCHES "disable_warnings_as_error.patch"
)

vcpkg_configure_cmake(
Expand Down
3 changes: 0 additions & 3 deletions cmake/ports/glslang/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

vcpkg_from_github(
Expand All @@ -13,7 +11,6 @@ vcpkg_from_github(
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS -DCMAKE_DEBUG_POSTFIX=d
)

vcpkg_install_cmake()
Expand Down
1 change: 0 additions & 1 deletion cmake/ports/hifi-scribe/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
include(vcpkg_common_functions)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
Expand Down
2 changes: 0 additions & 2 deletions cmake/ports/liblo/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO radarsat1/liblo
Expand Down
2 changes: 0 additions & 2 deletions cmake/ports/nlohmann-json/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

set(SOURCE_VERSION 3.3.0)

vcpkg_download_distfile(HEADER
Expand Down
1 change: 0 additions & 1 deletion cmake/ports/nvtt/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
#
include(vcpkg_common_functions)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
Expand Down
3 changes: 0 additions & 3 deletions cmake/ports/openexr/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

set(OPENEXR_VERSION 2.3.0)
set(OPENEXR_HASH 268ae64b40d21d662f405fba97c307dad1456b7d996a447aadafd41b640ca736d4851d9544b4741a94e7b7c335fe6e9d3b16180e710671abfc0c8b2740b147b2)

Expand All @@ -20,7 +18,6 @@ vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH}
OPTIONS
-DOPENEXR_BUILD_PYTHON_LIBS=OFF
-DOPENEXR_BUILD_VIEWERS=OFF
-DOPENEXR_ENABLE_TESTS=OFF
-DOPENEXR_RUN_FUZZ_TESTS=OFF
-DOPENEXR_BUILD_SHARED=${OPENEXR_SHARED}
-DOPENEXR_BUILD_STATIC=${OPENEXR_STATIC}
Expand Down
1 change: 0 additions & 1 deletion cmake/ports/openssl-android/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include(vcpkg_common_functions)
set(OPENSSL_VERSION 1.1.0g)
set(MASTER_COPY_SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src)

Expand Down
2 changes: 0 additions & 2 deletions cmake/ports/openssl-unix/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR NOT VCPKG_CMAKE_SYSTEM_NAME)
message(FATAL_ERROR "This port is only for openssl on Unix-like systems")
endif()
Expand Down
1 change: 0 additions & 1 deletion cmake/ports/openssl-windows/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ if(VCPKG_CMAKE_SYSTEM_NAME)
message(FATAL_ERROR "This port is only for building openssl on Windows Desktop")
endif()

include(vcpkg_common_functions)
set(OPENSSL_VERSION 1.1.1h)
set(MASTER_COPY_SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-${OPENSSL_VERSION})

Expand Down
2 changes: 0 additions & 2 deletions cmake/ports/openvr/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ValveSoftware/openvr
Expand Down
30 changes: 2 additions & 28 deletions cmake/ports/opus/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

vcpkg_from_github(
OUT_SOURCE_PATH
SOURCE_PATH
Expand All @@ -10,37 +8,13 @@ vcpkg_from_github(
SHA512
590b852e966a497e33d129b58bc07d1205fe8fea9b158334cd8a3c7f539332ef9702bba4a37bd0be83eb5f04a218cef87645251899f099695d01c1eb8ea6e2fd
HEAD_REF
master)

if(WIN32)
set(VIRCADIA_OPUS_OPTIONS "")
else()
if(EXISTS "${VCPKG_ROOT_DIR}/_env/VIRCADIA_OPTIMIZE.txt")
file(READ "${VCPKG_ROOT_DIR}/_env/VIRCADIA_OPTIMIZE.txt" VIRCADIA_OPTIMIZE)
endif()
if(EXISTS "${VCPKG_ROOT_DIR}/_env/VIRCADIA_CPU_ARCHITECTURE.txt")
file(READ "${VCPKG_ROOT_DIR}/_env/VIRCADIA_CPU_ARCHITECTURE.txt" VIRCADIA_CPU_ARCHITECTURE)
endif()

if(VIRCADIA_OPTIMIZE)
set(VIRCADIA_OPUS_OPTIONS "-DCMAKE_BUILD_TYPE=Release")
else()
set(VIRCADIA_OPUS_OPTIONS "-DCMAKE_BUILD_TYPE=RelWithDebInfo")
endif()

set(VIRCADIA_OPUS_OPTIONS "${VIRCADIA_OPUS_OPTIONS}")

if(DEFINED VIRCADIA_CPU_ARCHITECTURE)
set(VIRCADIA_OPUS_OPTIONS "${VIRCADIA_OPUS_OPTIONS} -DCMAKE_CXX_FLAGS=\"${VIRCADIA_CPU_ARCHITECTURE}\" -DCMAKE_C_FLAGS=\"${VIRCADIA_CPU_ARCHITECTURE}\" ")
endif()
endif()
master
)

message("Optimization options for Opus: ${VIRCADIA_OPUS_OPTIONS}")

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS ${VIRCADIA_OPUS_OPTIONS}
)

vcpkg_install_cmake()
Expand Down
2 changes: 0 additions & 2 deletions cmake/ports/polyvox/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

file(READ "${VCPKG_ROOT_DIR}/_env/EXTERNAL_BUILD_ASSETS.txt" EXTERNAL_BUILD_ASSETS)

# else Linux desktop
Expand Down
2 changes: 0 additions & 2 deletions cmake/ports/quazip/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

if(EXISTS "${VCPKG_ROOT_DIR}/_env/QT_CMAKE_PREFIX_PATH.txt")
# This environment var file only exists if we're overridding the default Qt location,
# which happens when using Qt from vcpkg, or using Qt from custom location
Expand Down
5 changes: 2 additions & 3 deletions cmake/ports/sdl2/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO SDL-Mirror/SDL
Expand Down Expand Up @@ -31,8 +29,9 @@ vcpkg_configure_cmake(
-DSDL_STATIC=${SDL_STATIC}
-DSDL_SHARED=${SDL_SHARED}
-DVIDEO_VULKAN=${VULKAN_VIDEO}
-DFORCE_STATIC_VCRT=${FORCE_STATIC_VCRT}
-DLIBC=ON
MAYBE_UNUSED_VARIABLES
-DFORCE_STATIC_VCRT=${FORCE_STATIC_VCRT} # Only available on MSVC
)

vcpkg_install_cmake()
Expand Down
2 changes: 0 additions & 2 deletions cmake/ports/shaderc/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO google/shaderc
Expand Down
2 changes: 0 additions & 2 deletions cmake/ports/spirv-cross/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

vcpkg_from_github(
Expand Down
2 changes: 0 additions & 2 deletions cmake/ports/spirv-tools/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

vcpkg_from_github(
Expand Down
1 change: 0 additions & 1 deletion cmake/ports/sranipal/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include(vcpkg_common_functions)
set(SRANIPAL_VERSION 1.1.0.1)
set(MASTER_COPY_SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src)

Expand Down
5 changes: 0 additions & 5 deletions cmake/ports/tbb/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO oneapi-src/oneTBB
Expand Down Expand Up @@ -118,6 +116,3 @@ file(WRITE ${CURRENT_PACKAGES_DIR}/share/tbb/TBBConfig.cmake "${_contents}")
# Handle copyright
file(COPY ${SOURCE_PATH}/LICENSE ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/tbb)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/tbb/LICENSE ${CURRENT_PACKAGES_DIR}/share/tbb/copyright)

vcpkg_test_cmake(PACKAGE_NAME TBB)
#
1 change: 0 additions & 1 deletion cmake/ports/vhacd/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include(vcpkg_common_functions)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

file(READ "${VCPKG_ROOT_DIR}/_env/EXTERNAL_BUILD_ASSETS.txt" EXTERNAL_BUILD_ASSETS)
Expand Down
2 changes: 0 additions & 2 deletions cmake/ports/vulkanmemoryallocator/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

set(SOURCE_VERSION 3.3.0)

vcpkg_from_github(
Expand Down
3 changes: 1 addition & 2 deletions cmake/ports/webrtc/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include(vcpkg_common_functions)
set(WEBRTC_VERSION 20210105)
set(MASTER_COPY_SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src)

Expand Down Expand Up @@ -30,7 +29,7 @@ else ()
)
endif ()

vcpkg_extract_source_archive(${WEBRTC_SOURCE_ARCHIVE})
vcpkg_extract_source_archive(MASTER_COPY_SOURCE_PATH ARCHIVE ${WEBRTC_SOURCE_ARCHIVE} NO_REMOVE_ONE_LEVEL)

file(COPY ${MASTER_COPY_SOURCE_PATH}/webrtc/include DESTINATION ${CURRENT_PACKAGES_DIR})
file(COPY ${MASTER_COPY_SOURCE_PATH}/webrtc/lib DESTINATION ${CURRENT_PACKAGES_DIR})
Expand Down
4 changes: 0 additions & 4 deletions cmake/ports/zlib/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

set(VERSION 1.2.12)

vcpkg_download_distfile(ARCHIVE_FILE
Expand Down Expand Up @@ -46,5 +44,3 @@ file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DI
vcpkg_copy_pdbs()

file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})

vcpkg_test_cmake(PACKAGE_NAME ZLIB MODULE)

0 comments on commit a6a889a

Please sign in to comment.