diff options
author | Erik Kundiman <erik@megapahit.org> | 2025-05-27 10:01:21 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2025-05-27 10:01:21 +0800 |
commit | 7ecde89008f9ed39c357b606d3bc231ba4360ee2 (patch) | |
tree | 7d07879bafb753fb731257967d10b037c907fe2e /indra/cmake/LLPrimitive.cmake | |
parent | d038a69f60725296715285b23e5de049c7824c11 (diff) |
Pass configuration phase with vcpkg replacing MSYS2
I happen to be using just Git Bash for convenience for running the
commands on the Windows build instructions, hence the build folder
pattern to be ignored from the result of running `uname -s` there.
The instructions omit the part where you install vcpkg and set the
VCPKG_ROOT environment variable, cause it depends on where you install
vcpkg to your liking, but the next commands will rely on that variable
being set correctly.
The CMake used here is MS VS 2022 Community Edition's one, since it will
know where the C++ compiler is.
$VCPKG_ROOT/downloads/tools/msys2/21caed2f81ec917b/mingw64/bin is where
pkg-config.exe can be found.
$VCPKG_ROOT/installed/`uname -m|sed 's/86_//'`-windows/tools/libxml2 is
where xmllint.exe can be found (from libxml2[tools]).
PKG_CONFIG_LIBDIR and PYTHON environment settings are pretty
self-explanatory.
The flags set on LL_BUILD are now for Visual C++ and not MinGW(64)'s GCC
or Clang any more, and copied from most of the flags in the variables
file from LL's build-variables repo.
vcpkg's apr & apr-util packages don't seem to install their .pc files,
hence the manual target_include/link_directories/libraries settings,
relying on some automatically generated INTERNAL CMake variable called
prefix_result. vcpkg's Boost needs the same treatment, plus some suffix.
We still use LL's prebuilt libs for OpenSSL, libcurl and WebRTC.
Actually too for ColladaDOM for now, but we prepare Windows ColladaDOM
self-building for later.
For GLM and Meshoptimizer too, it's just the checking that's skipped
otherwise it would fail (but the vcpkg packages can be used).
Visual C++ doesn't recognise the no-deprecated-declarations compile
option.
On Visual C++, the macro to denote x86-64 seems to be _M_X64 (if not
added there, it would try to find sse2neon :))
We still aren't using Autobuild here for Windows either, hence the
FALSE-d viewer_manifest.py based file bundling.
Diffstat (limited to 'indra/cmake/LLPrimitive.cmake')
-rw-r--r-- | indra/cmake/LLPrimitive.cmake | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake index 21952713ca..bbda10fbaa 100644 --- a/indra/cmake/LLPrimitive.cmake +++ b/indra/cmake/LLPrimitive.cmake @@ -18,19 +18,11 @@ if( USE_CONAN ) "${CONAN_INCLUDE_DIRS_COLLADADOM}/collada-dom/1.4/" ) endif() -if( WINDOWS ) - include(FindPkgConfig) - pkg_check_modules(Colladadom REQUIRED collada-dom-141) - target_compile_definitions( ll::colladadom INTERFACE COLLADA_DOM_SUPPORT141 ) - target_include_directories( ll::colladadom SYSTEM INTERFACE ${Colladadom_INCLUDE_DIRS} ) - target_link_directories( ll::colladadom INTERFACE ${Colladadom_LIBRARY_DIRS} ) - target_link_libraries( ll::colladadom INTERFACE ${Colladadom_LIBRARIES} ) - return() -elseif( LINUX OR CMAKE_SYSTEM_NAME MATCHES FreeBSD ) +if( LINUX OR CMAKE_SYSTEM_NAME MATCHES FreeBSD ) # Build of the collada-dom for Linux and FreeBSD is done in # indra/llprimitive/CMakeLists.txt return() -else() +elseif ( WINDOWS ) include(FindPkgConfig) pkg_check_modules(Minizip REQUIRED minizip) pkg_check_modules(Libxml2 REQUIRED libxml-2.0) @@ -47,15 +39,24 @@ else() INPUT ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r8.tar.gz DESTINATION ${CMAKE_BINARY_DIR} ) - execute_process( - COMMAND sed -i "" -e "s/SHARED/STATIC/g" CMakeLists.txt - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r8/src/1.4 - ) + if ( WINDOWS ) + execute_process( + COMMAND sed -i "s/SHARED/STATIC/g" CMakeLists.txt + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r8/src/1.4 + ) + set(BOOST_LIBRARY_SUFFIX -vc143-mt-x64-1_88) + else () + execute_process( + COMMAND sed -i "" -e "s/SHARED/STATIC/g" CMakeLists.txt + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r8/src/1.4 + ) + endif () if( DARWIN ) set(BOOST_CFLAGS -I${Libxml2_LIBRARY_DIRS}exec/boost/1.87/include) set(BOOST_LIBS -L${Minizip_LIBRARY_DIRS}exec/boost/1.87/lib) set(BOOST_LIBRARY_SUFFIX -mt) endif() + file(MAKE_DIRECTORY ${LIBS_PREBUILT_DIR}/include/collada/1.4) try_compile(COLLADADOM_RESULT PROJECT colladadom SOURCE_DIR ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r8 @@ -92,10 +93,12 @@ else() endif() endif() -if( FALSE ) -use_system_binary( colladadom ) +#use_system_binary( colladadom ) +if (WINDOWS) use_prebuilt_binary(colladadom) +endif () +if( FALSE ) use_prebuilt_binary(minizip-ng) # needed for colladadom use_prebuilt_binary(libxml2) |