diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..5f627679c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,139 @@ +name: Build + +on: [push] + +jobs: + build-linux-gcc: + name: Build Linux (GCC x86_64) + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Install dependencies + shell: bash + run: | + sudo apt-get update + sudo apt-get -y install build-essential curl git ninja-build llvm-dev libclang-dev clang lld zlib1g-dev \ + libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev libpulse-dev \ + libudev-dev libpng-dev libncurses5-dev cmake libx11-xcb-dev python3 python-is-python3 qt5-default + - name: Create build directory + shell: bash + run: cmake -E make_directory ${{github.workspace}}/build + - name: Configure CMake + shell: bash + working-directory: ${{github.workspace}}/build + run: cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=MinSizeRel -DURDE_VECTOR_ISA=sse41 + - name: Build + shell: bash + working-directory: ${{github.workspace}}/build + run: cmake --build . --config $BUILD_TYPE + + build-linux-clang: + name: Build Linux (Clang x86_64) + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Install dependencies + shell: bash + run: | + sudo apt-get update + sudo apt-get -y install build-essential curl git ninja-build llvm-dev libclang-dev clang lld zlib1g-dev \ + libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev libpulse-dev \ + libudev-dev libpng-dev libncurses5-dev cmake libx11-xcb-dev python3 python-is-python3 qt5-default + - name: Create build directory + shell: bash + run: cmake -E make_directory ${{github.workspace}}/build + - name: Configure CMake + shell: bash + working-directory: ${{github.workspace}}/build + run: cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=MinSizeRel -DURDE_VECTOR_ISA=sse41 -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ + - name: Build + shell: bash + working-directory: ${{github.workspace}}/build + run: cmake --build . --config $BUILD_TYPE + + build-macos: + name: Build macOS (Clang x86_64) + runs-on: macos-10.15 + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Install dependencies + shell: bash + run: brew install ninja qt + - name: Create build directory + shell: bash + run: cmake -E make_directory ${{github.workspace}}/build + - name: Configure CMake + shell: bash + working-directory: ${{github.workspace}}/build + run: cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=MinSizeRel -DURDE_VECTOR_ISA=sse41 + - name: Build + shell: bash + working-directory: ${{github.workspace}}/build + run: cmake --build . --config $BUILD_TYPE + + build-windows-msvc: + name: Build Windows (MSVC x86_64) + runs-on: windows-2019 + if: 'false' # disabled for now + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - uses: suisei-cn/actions-download-file@v1 + name: Download LLVM + id: download-llvm + with: + url: https://axiodl.com/files/LLVM-10.0.1-win64.exe + target: ${{github.workspace}}/temp + - name: Install LLVM + shell: cmd + working-directory: ${{github.workspace}}/temp + run: ${{steps.download-llvm.outputs.filename}} /S + - uses: ilammy/msvc-dev-cmd@v1 + name: Enable Visual Studio environment + - name: Install ninja + run: choco install ninja + - name: Create build directory + run: cmake -E make_directory ${{github.workspace}}/build + - name: Configure CMake + working-directory: ${{github.workspace}}/build + run: cmake .. -GNinja -DCMAKE_BUILD_TYPE=MinSizeRel -DURDE_VECTOR_ISA=sse41 -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_CXX_FLAGS= -DCMAKE_C_FLAGS= + - name: Build + working-directory: ${{github.workspace}}/build + run: cmake --build . --config $BUILD_TYPE + + build-windows-clang: + name: Build Windows (Clang x86_64) + runs-on: windows-2019 + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - uses: suisei-cn/actions-download-file@v1 + name: Download LLVM + id: download-llvm + with: + url: https://axiodl.com/files/LLVM-10.0.1-win64.exe + target: ${{github.workspace}}/temp + - name: Install LLVM + shell: cmd + working-directory: ${{github.workspace}}/temp + run: ${{steps.download-llvm.outputs.filename}} /S + - uses: ilammy/msvc-dev-cmd@v1 + name: Enable Visual Studio environment + - name: Install ninja + run: choco install ninja + - name: Create build directory + run: cmake -E make_directory ${{github.workspace}}/build + - name: Configure CMake + working-directory: ${{github.workspace}}/build + run: cmake .. -GNinja -DCMAKE_BUILD_TYPE=MinSizeRel -DURDE_VECTOR_ISA=sse41 -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_C_COMPILER="C:/Program Files/LLVM/bin/clang-cl.exe" -DCMAKE_CXX_COMPILER="C:/Program Files/LLVM/bin/clang-cl.exe" -DCMAKE_LINKER="C:/Program Files/LLVM/bin/lld-link.exe" + - name: Build + working-directory: ${{github.workspace}}/build + run: cmake --build . --config $BUILD_TYPE diff --git a/CMakeLists.txt b/CMakeLists.txt index d7411e28e..7da2e6f72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,11 +54,9 @@ set(BUILD_STATIC_LIBS ON CACHE BOOL "Force static libs on" FORCE) list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/sanitizers-cmake/cmake") find_package(Sanitizers) -if (NX) - set(URDE_VECTOR_ISA "neon") -else() - set(URDE_VECTOR_ISA "sse2" CACHE STRING "Vector ISA to build for (sse2, sse3, sse41, avx, avx2)") -endif() +if (CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64) + set(URDE_VECTOR_ISA "sse41" CACHE STRING "Vector ISA to build for (sse2, sse3, sse41, avx, avx2)") +endif () if(MSVC) if(${URDE_VECTOR_ISA} STREQUAL "avx2") @@ -71,6 +69,10 @@ if(MSVC) message(STATUS "Building with AVX Vector ISA") elseif(${URDE_VECTOR_ISA} STREQUAL "sse41") add_compile_definitions(__SSE4_1__=1) + # clang-cl 10 requires -msse4.1, may be fixed in newer versions? + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL Clang) + add_compile_options(-msse4.1) + endif() message(STATUS "Building with SSE4.1 Vector ISA") else() message(STATUS "Building with SSE2 Vector ISA") @@ -150,8 +152,6 @@ else() elseif(${URDE_VECTOR_ISA} STREQUAL "sse2") add_compile_options(-msse2) message(STATUS "Building with SSE2 Vector ISA") - elseif(${URDE_VECTOR_ISA} STREQUAL "neon") - message(STATUS "Building with NEON Vector ISA") else() message(STATUS "Building with x87 Vector ISA") endif() @@ -181,7 +181,7 @@ else() if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") add_compile_options(-Wno-unknown-warning-option -Wno-unused-private-field) elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - add_compile_options(-Wno-lto-type-mismatch) + add_compile_options(-Wno-lto-type-mismatch -Wno-maybe-uninitialized) endif() add_compile_definitions(FMT_EXCEPTIONS=0) diff --git a/Shaders/shader_CFluidPlaneShaderGLSL.cpp b/Shaders/shader_CFluidPlaneShaderGLSL.cpp index 7e7e218f4..12011089d 100644 --- a/Shaders/shader_CFluidPlaneShaderGLSL.cpp +++ b/Shaders/shader_CFluidPlaneShaderGLSL.cpp @@ -328,7 +328,10 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { std::stringstream out; int nextTex = 0; int nextTCG = 3; - int bumpMapUv, envBumpMapUv, envMapUv, lightmapUv; + int bumpMapUv = -1; + int envBumpMapUv = -1; + int envMapUv = -1; + int lightmapUv = -1; out << "#define TEXTURE_DECLS "; if (info.m_hasPatternTex1) diff --git a/Shaders/shader_CFluidPlaneShaderHLSL.cpp b/Shaders/shader_CFluidPlaneShaderHLSL.cpp index ebf81e869..824936bf9 100644 --- a/Shaders/shader_CFluidPlaneShaderHLSL.cpp +++ b/Shaders/shader_CFluidPlaneShaderHLSL.cpp @@ -364,7 +364,10 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { int nextTex = 0; int nextTCG = 3; int nextMtx = 4; - int bumpMapUv, envBumpMapUv, envMapUv, lightmapUv; + int bumpMapUv = -1; + int envBumpMapUv = -1; + int envMapUv = -1; + int lightmapUv = -1; out << "#define TEXTURE_DECLS "; if (info.m_hasPatternTex1) diff --git a/Shaders/shader_CFluidPlaneShaderMetal.cpp b/Shaders/shader_CFluidPlaneShaderMetal.cpp index 728d580a3..035d00c50 100644 --- a/Shaders/shader_CFluidPlaneShaderMetal.cpp +++ b/Shaders/shader_CFluidPlaneShaderMetal.cpp @@ -362,7 +362,10 @@ static std::string _BuildFS(const SFluidPlaneShaderInfo& info) { std::stringstream out; int nextTex = 0; int nextTCG = 3; - int bumpMapUv, envBumpMapUv, envMapUv, lightmapUv; + int bumpMapUv = -1; + int envBumpMapUv = -1; + int envMapUv = -1; + int lightmapUv = -1; out << "#define TEXTURE_PARAMS "; if (info.m_hasPatternTex1) diff --git a/amuse b/amuse index 2ec749e6c..df7136d26 160000 --- a/amuse +++ b/amuse @@ -1 +1 @@ -Subproject commit 2ec749e6c7d69ce85bf2fad09339eeead02f209f +Subproject commit df7136d265d1ca15a7851dfec2c8b7ee0dd9de86