From 68c50c8a313addb996ebd6d55679d8508e997851 Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Tue, 10 Sep 2024 22:25:52 -0400 Subject: [PATCH] Local windows build in progress --- extern/CMakeLists.txt | 168 +++++++++++++++++--- src/core/CMakeLists.txt | 176 +++++++++++++++++---- vcpkg/triplets/x64-windows-omniverse.cmake | 9 ++ 3 files changed, 298 insertions(+), 55 deletions(-) create mode 100644 vcpkg/triplets/x64-windows-omniverse.cmake diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 7e2ca648..cd76441c 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -1,26 +1,120 @@ include(Macros) -# cmake-format: off -add_external_project( - PROJECT_NAME - cesium-native - LIBRARIES - Cesium3DTilesSelection - Cesium3DTilesReader - Cesium3DTilesContent - CesiumRasterOverlays - CesiumGltfReader - CesiumGltfContent - CesiumGltf - CesiumQuantizedMeshTerrain - CesiumJsonReader - CesiumGeospatial - CesiumGeometry - CesiumIonClient - CesiumAsync - CesiumUtility +if(MSVC) + set(CESIUM_NATIVE_DEPENDENCIES + async++ + draco + glm + jpeg + ktx + libmodpbase64 + meshoptimizer + s2 + absl_cordz_sample_token + absl_die_if_null + absl_failure_signal_handler + absl_flags_parse + absl_log_flags + absl_log_initialize + absl_periodic_sampler + absl_random_internal_distribution_test_util + absl_scoped_set_env + absl_statusor + absl_bad_any_cast_impl + absl_log_internal_check_op + absl_leak_check + absl_flags_usage + absl_flags_usage_internal + absl_flags_internal + absl_flags_reflection + absl_flags_config + absl_flags_program_name + absl_flags_private_handle_accessor + absl_flags_commandlineflag + absl_flags_commandlineflag_internal + absl_flags_marshalling + absl_log_internal_conditions + absl_log_internal_message + absl_examine_stack + absl_log_internal_nullguard + absl_log_internal_format + absl_log_internal_proto + absl_log_internal_log_sink_set + absl_log_globals + absl_vlog_config_internal + absl_log_internal_fnmatch + absl_log_internal_globals + absl_log_sink + absl_log_entry + absl_raw_hash_set + absl_hash + absl_city + absl_low_level_hash + absl_hashtablez_sampler + absl_random_distributions + absl_random_seed_sequences + absl_random_internal_pool_urbg + absl_random_internal_randen + absl_random_internal_randen_hwaes + absl_random_internal_randen_hwaes_impl + absl_random_internal_randen_slow + absl_random_internal_platform + absl_random_internal_seed_material + absl_random_seed_gen_exception + absl_status + absl_cord + absl_cordz_info + absl_cordz_handle + absl_cordz_functions + absl_exponential_biased + absl_synchronization + absl_graphcycles_internal + absl_kernel_timeout_internal + absl_time + absl_civil_time + absl_time_zone + absl_cord_internal + absl_crc_cord_state + absl_crc32c + absl_crc_internal + absl_crc_cpu_detect + absl_stacktrace + absl_bad_optional_access + absl_str_format_internal + absl_strerror + absl_symbolize + absl_strings + absl_strings_internal + absl_int128 + absl_string_view + absl_throw_delegate + absl_debugging_internal + absl_malloc_internal + absl_demangle_internal + absl_base + absl_spinlock_wait + absl_bad_variant_access + absl_raw_logging_internal + absl_log_severity + libcrypto + libssl + spdlog + fmt + sqlite3 + tinyxml2 + turbojpeg + uriparser + libwebp + libwebpdecoder + libwebpdemux + libwebpmux + astcenc-avx2-static + libsharpyuv + zlibstatic-ng + zstd) +else() + set(CESIUM_NATIVE_DEPENDENCIES async++ - csprng draco glm jpeg @@ -129,7 +223,29 @@ add_external_project( astcenc-avx2-static sharpyuv z-ng - zstd + zstd) +endif() + +# cmake-format: off +add_external_project( + PROJECT_NAME + cesium-native + LIBRARIES + Cesium3DTilesSelection + Cesium3DTilesReader + Cesium3DTilesContent + CesiumRasterOverlays + CesiumGltfReader + CesiumGltfContent + CesiumGltf + CesiumQuantizedMeshTerrain + CesiumJsonReader + CesiumGeospatial + CesiumGeometry + CesiumIonClient + CesiumAsync + CesiumUtility + ${CESIUM_NATIVE_DEPENDENCIES} OPTIONS CESIUM_TESTS_ENABLED=OFF CESIUM_COVERAGE_ENABLED=OFF @@ -138,12 +254,12 @@ add_external_project( VCPKG_OVERLAY_TRIPLETS=${VCPKG_OVERLAY_TRIPLETS} PROJECT_EXTERN_DIRECTORY "${PROJECT_SOURCE_DIR}/extern" - EXPECTED_DEBUG_POSTFIX "d" ) # cmake-format: on if(NOT ${USE_NVIDIA_RELEASE_LIBRARIES}) - execute_process(COMMAND "${Python3_EXECUTABLE}" "${SCRIPTS_DIRECTORY}/copy_from_dir.py" "*.user.xml" "${PROJECT_SOURCE_DIR}/extern/nvidia/debug-deps" "${PROJECT_SOURCE_DIR}/extern/nvidia/deps") + execute_process(COMMAND "${Python3_EXECUTABLE}" "${SCRIPTS_DIRECTORY}/copy_from_dir.py" "*.user.xml" + "${PROJECT_SOURCE_DIR}/extern/nvidia/debug-deps" "${PROJECT_SOURCE_DIR}/extern/nvidia/deps") endif() if(WIN32) @@ -155,9 +271,11 @@ else() endif() if(UNIX) - execute_process(COMMAND bash -c "${PROJECT_SOURCE_DIR}/extern/nvidia/build.sh --platform ${NVIDIA_PLATFORM_NAME}" RESULT_VARIABLE exit_code) + execute_process(COMMAND bash -c "${PROJECT_SOURCE_DIR}/extern/nvidia/build.sh --platform ${NVIDIA_PLATFORM_NAME}" + RESULT_VARIABLE exit_code) elseif(WIN32) - execute_process(COMMAND cmd /C "${PROJECT_SOURCE_DIR}/extern/nvidia/build.bat --platform ${NVIDIA_PLATFORM_NAME}" RESULT_VARIABLE exit_code) + execute_process(COMMAND cmd /C "${PROJECT_SOURCE_DIR}/extern/nvidia/build.bat --platform ${NVIDIA_PLATFORM_NAME}" + RESULT_VARIABLE exit_code) endif() # cmake-format: off diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 00903f19..644eb719 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -21,36 +21,121 @@ glob_files(SOURCES "${CMAKE_CURRENT_LIST_DIR}/src/*.cpp") get_property(ADDITIONAL_LIBRARIES GLOBAL PROPERTY NVIDIA_ADDITIONAL_LIBRARIES_PROPERTY) get_property(ADDITIONAL_LINK_DIRECTORIES GLOBAL PROPERTY NVIDIA_ADDITIONAL_LINK_DIRECTORIES_PROPERTY) -# cmake-format: off -setup_lib( - TARGET_NAME - CesiumOmniverseCore - TYPE - # CesiumOmniverseCore needs to be built as a STATIC library always so that it can be tested. - # Otherwise if it was built as a shared library we would have to add dllexport attributes to almost everything. - STATIC - SOURCES - ${SOURCES} - INCLUDE_DIRS - "${CMAKE_CURRENT_LIST_DIR}/include" - LIBRARIES - CesiumUsdSchemas - Cesium3DTilesSelection - Cesium3DTilesReader - Cesium3DTilesContent - CesiumRasterOverlays - CesiumGltfReader - CesiumGltfContent - CesiumGltf - CesiumQuantizedMeshTerrain - CesiumJsonReader - CesiumGeospatial - CesiumGeometry - CesiumIonClient - CesiumAsync - CesiumUtility +if(MSVC) + set(CESIUM_NATIVE_DEPENDENCIES + async++ + draco + glm + jpeg + ktx + libmodpbase64 + meshoptimizer + s2 + absl_cordz_sample_token + absl_die_if_null + absl_failure_signal_handler + absl_flags_parse + absl_log_flags + absl_log_initialize + absl_periodic_sampler + absl_random_internal_distribution_test_util + absl_scoped_set_env + absl_statusor + absl_bad_any_cast_impl + absl_log_internal_check_op + absl_leak_check + absl_flags_usage + absl_flags_usage_internal + absl_flags_internal + absl_flags_reflection + absl_flags_config + absl_flags_program_name + absl_flags_private_handle_accessor + absl_flags_commandlineflag + absl_flags_commandlineflag_internal + absl_flags_marshalling + absl_log_internal_conditions + absl_log_internal_message + absl_examine_stack + absl_log_internal_nullguard + absl_log_internal_format + absl_log_internal_proto + absl_log_internal_log_sink_set + absl_log_globals + absl_vlog_config_internal + absl_log_internal_fnmatch + absl_log_internal_globals + absl_log_sink + absl_log_entry + absl_raw_hash_set + absl_hash + absl_city + absl_low_level_hash + absl_hashtablez_sampler + absl_random_distributions + absl_random_seed_sequences + absl_random_internal_pool_urbg + absl_random_internal_randen + absl_random_internal_randen_hwaes + absl_random_internal_randen_hwaes_impl + absl_random_internal_randen_slow + absl_random_internal_platform + absl_random_internal_seed_material + absl_random_seed_gen_exception + absl_status + absl_cord + absl_cordz_info + absl_cordz_handle + absl_cordz_functions + absl_exponential_biased + absl_synchronization + absl_graphcycles_internal + absl_kernel_timeout_internal + absl_time + absl_civil_time + absl_time_zone + absl_cord_internal + absl_crc_cord_state + absl_crc32c + absl_crc_internal + absl_crc_cpu_detect + absl_stacktrace + absl_bad_optional_access + absl_str_format_internal + absl_strerror + absl_symbolize + absl_strings + absl_strings_internal + absl_int128 + absl_string_view + absl_throw_delegate + absl_debugging_internal + absl_malloc_internal + absl_demangle_internal + absl_base + absl_spinlock_wait + absl_bad_variant_access + absl_raw_logging_internal + absl_log_severity + libcrypto + libssl + spdlog + fmt + sqlite3 + tinyxml2 + turbojpeg + uriparser + libwebp + libwebpdecoder + libwebpdemux + libwebpmux + astcenc-avx2-static + libsharpyuv + zlibstatic-ng + zstd) +else() + set(CESIUM_NATIVE_DEPENDENCIES async++ - csprng draco glm jpeg @@ -159,7 +244,38 @@ setup_lib( astcenc-avx2-static sharpyuv z-ng - zstd + zstd) +endif() + +# cmake-format: off +setup_lib( + TARGET_NAME + CesiumOmniverseCore + TYPE + # CesiumOmniverseCore needs to be built as a STATIC library always so that it can be tested. + # Otherwise if it was built as a shared library we would have to add dllexport attributes to almost everything. + STATIC + SOURCES + ${SOURCES} + INCLUDE_DIRS + "${CMAKE_CURRENT_LIST_DIR}/include" + LIBRARIES + CesiumUsdSchemas + Cesium3DTilesSelection + Cesium3DTilesReader + Cesium3DTilesContent + CesiumRasterOverlays + CesiumGltfReader + CesiumGltfContent + CesiumGltf + CesiumQuantizedMeshTerrain + CesiumJsonReader + CesiumGeospatial + CesiumGeometry + CesiumIonClient + CesiumAsync + CesiumUtility + ${CESIUM_NATIVE_DEPENDENCIES} CURL::libcurl stb::stb ZLIB::ZLIB diff --git a/vcpkg/triplets/x64-windows-omniverse.cmake b/vcpkg/triplets/x64-windows-omniverse.cmake new file mode 100644 index 00000000..9d4903ed --- /dev/null +++ b/vcpkg/triplets/x64-windows-omniverse.cmake @@ -0,0 +1,9 @@ +include("${CMAKE_CURRENT_LIST_DIR}/shared/common.cmake") + +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) + +# Techically we should be setting /MDd if USE_NVIDIA_RELEASE_LIBRARIES is false +set(VCPKG_CXX_FLAGS "/MD /MP /EHsc") +set(VCPKG_C_FLAGS "${VCPKG_CXX_FLAGS}")