diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1fa8bb96..9f08dd7a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,6 +29,7 @@ jobs: target: template_release platform: linux arch: x86_64 + precision: double # - identifier: windows-debug # name: 🪟 Windows (Debug) # build_type: Debug @@ -43,6 +44,7 @@ jobs: target: template_release platform: windows arch: x86_64 + precision: double # - identifier: macos-debug # name: 🍎 MacOS (Debug) # build_type: Debug @@ -55,18 +57,21 @@ jobs: runner: macos-latest target: template_release platform: macos + precision: double - identifier: android-arm64 name: 🤖 Android Arm64 build_type: Release runner: ubuntu-20.04 platform: android arch: arm64-v8a + precision: double - identifier: android-arm32 name: 🤖 Android Arm32 build_type: Release runner: ubuntu-20.04 platform: android arch: armeabi-v7a + precision: double runs-on: ${{ matrix.runner }} name: ${{ matrix.name }} @@ -106,21 +111,21 @@ jobs: if: startsWith(matrix.identifier, 'linux-') || startsWith(matrix.identifier, 'macos-') shell: sh run: | - cmake -B ${{ github.workspace }}/.out-${{ matrix.identifier }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -S ${{ github.workspace }} -G Ninja + cmake -B ${{ github.workspace }}/.out-${{ matrix.identifier }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -S ${{ github.workspace }} -G Ninja -DGODOT_FLOAT_PRECISION=${{ matrix.precision }} cmake --build ${{ github.workspace }}/.out-${{ matrix.identifier }} --target orchestrator -j 18 - name: Build Orchestrator (Windows) if: startsWith(matrix.identifier, 'windows-') shell: bash run: | - cmake -B '${{ github.workspace }}/.out-${{ matrix.identifier }}' -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -S '${{ github.workspace }}' -G Ninja + cmake -B '${{ github.workspace }}/.out-${{ matrix.identifier }}' -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -S '${{ github.workspace }}' -G Ninja -DGODOT_FLOAT_PRECISION=${{ matrix.precision }} cmake --build '${{ github.workspace }}/.out-${{ matrix.identifier }}' --target orchestrator -j 18 - name: Build Orchestrator (Android) if: startsWith(matrix.identifier, 'android-') shell: sh run: | - cmake -B ${{ github.workspace }}/.out-${{ matrix.identifier }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_ANDROID_ARCH_ABI=${{ matrix.arch }} -DANDROID_ABI=${{ matrix.arch }} -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.9 -DANDROID_PLATFORM=android-23 -DANDROID_TOOLCHAIN=clang -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -S ${{ github.workspace }} + cmake -B ${{ github.workspace }}/.out-${{ matrix.identifier }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_ANDROID_ARCH_ABI=${{ matrix.arch }} -DANDROID_ABI=${{ matrix.arch }} -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.9 -DANDROID_PLATFORM=android-23 -DANDROID_TOOLCHAIN=clang -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -S ${{ github.workspace }} -DGODOT_FLOAT_PRECISION=${{ matrix.precision }} cmake --build ${{ github.workspace }}/.out-${{ matrix.identifier }} --target orchestrator -j 18 - name: Prepare addon files diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d8cfc9a..deb6f394 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,8 @@ SET(GDEXTENSION_LIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/project/addons/orchestrato # ADD_COMPILE_DEFINITIONS(HOT_RELOAD_ENABLED) add_compile_definitions(TOOLS_ENABLED) +set(GODOT_FLOAT_PRECISION "single" CACHE STRING "") + OPTION( AUTOFORMAT_SRC_ON_CONFIGURE "If enabled, clang-format will be used to format all sources in src/ during configuration" @@ -89,6 +91,10 @@ FILE(GLOB_RECURSE gdext_sources "${CMAKE_CURRENT_SOURCE_DIR}/src/*.[hc]pp" ) +if ("${GODOT_FLOAT_PRECISION}" STREQUAL "double") + add_compile_definitions(REAL_T_IS_DOUBLE) +endif() + # GDExtension library ADD_LIBRARY(${PROJECT_NAME} SHARED ${gdext_sources}) @@ -100,6 +106,7 @@ TARGET_COMPILE_OPTIONS(${PROJECT_NAME} PUBLIC $<${compiler_is_msvc}: /EHsc /utf-8 + $<$:/DREAL_T_IS_DOUBLE> /Zc:preprocessor /wd5054 # operator '|' deprecated between enumerations of different types $<$: diff --git a/extern/godot-engine b/extern/godot-engine index 811ce36c..4ab8fb80 160000 --- a/extern/godot-engine +++ b/extern/godot-engine @@ -1 +1 @@ -Subproject commit 811ce36c6090013f1a48676c0388892bf1621288 +Subproject commit 4ab8fb809396fa38ba929fec97cfcb7193f1c44d