diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9bdfeab7e..c33a3adc9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,46 +9,42 @@ jobs: strategy: matrix: - compiler: [ - g++-7, g++-8, g++-9, g++, - clang++-8, clang++-9, clang++-10, clang++ - ] + compiler: + - pkg: g++-7 + exe: g++-7 + - pkg: g++-8 + exe: g++-8 + - pkg: g++-9 + exe: g++-9 + - pkg: g++ + exe: g++ + - pkg: clang-8 + exe: clang++-8 + - pkg: clang-9 + exe: clang++-9 + - pkg: clang-10 + exe: clang++-10 + - pkg: clang + exe: clang++ + id_type: [uint32, uint64] + include: + - id_type: uint64 + id_type_option: -DENTT_BUILD_UINT64=ON runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Install g++-7 - if: ${{ matrix.compiler == 'g++-7' }} + - name: Install compiler run: | sudo apt-get update - sudo apt-get install g++-7 -y - - name: Install g++-8 - if: ${{ matrix.compiler == 'g++-8' }} - run: | - sudo apt-get update - sudo apt-get install g++-8 -y - - name: Install clang-8 - if: ${{ matrix.compiler == 'clang++-8' }} - run: | - sudo apt-get update - sudo apt-get install clang-8 -y - - name: Install clang-9 - if: ${{ matrix.compiler == 'clang++-9' }} - run: | - sudo apt-get update - sudo apt-get install clang-9 -y - - name: Install clang-10 - if: ${{ matrix.compiler == 'clang++-10' }} - run: | - sudo apt-get update - sudo apt-get install clang-10 -y + sudo apt-get install ${{ matrix.compiler.pkg }} -y - name: Compile tests working-directory: build env: - CXX: ${{ matrix.compiler }} + CXX: ${{ matrix.compiler.exe }} run: | - cmake -DENTT_BUILD_TESTING=ON -DENTT_BUILD_LIB=ON -DENTT_BUILD_EXAMPLE=ON .. + cmake -DENTT_BUILD_TESTING=ON -DENTT_BUILD_LIB=ON -DENTT_BUILD_EXAMPLE=ON ${{ matrix.id_type_option }} .. make -j4 - name: Run tests working-directory: build @@ -63,11 +59,14 @@ jobs: matrix: os: [windows-latest, windows-2016] toolset: [clang-cl, default, v141] + id_type: [uint32, uint64] include: - toolset: clang-cl toolset_option: -T"ClangCl" - toolset: v141 toolset_option: -T"v141" + - id_type: uint64 + id_type_option: -DENTT_BUILD_UINT64=ON exclude: - os: windows-2016 toolset: clang-cl @@ -81,7 +80,7 @@ jobs: - name: Compile tests working-directory: build run: | - cmake -DENTT_BUILD_TESTING=ON -DENTT_BUILD_LIB=ON -DENTT_BUILD_EXAMPLE=ON ${{ matrix.toolset_option }} .. + cmake -DENTT_BUILD_TESTING=ON -DENTT_BUILD_LIB=ON -DENTT_BUILD_EXAMPLE=ON ${{ matrix.id_type_option }} ${{ matrix.toolset_option }} .. cmake --build . -j 4 - name: Run tests working-directory: build @@ -91,6 +90,14 @@ jobs: macos: timeout-minutes: 10 + + strategy: + matrix: + id_type: [uint32, uint64] + include: + - id_type: uint64 + id_type_option: -DENTT_BUILD_UINT64=ON + runs-on: macOS-latest steps: @@ -98,7 +105,7 @@ jobs: - name: Compile tests working-directory: build run: | - cmake -DENTT_BUILD_TESTING=ON -DENTT_BUILD_LIB=ON -DENTT_BUILD_EXAMPLE=ON .. + cmake -DENTT_BUILD_TESTING=ON -DENTT_BUILD_LIB=ON -DENTT_BUILD_EXAMPLE=ON ${{ matrix.id_type_option }} .. make -j4 - name: Run tests working-directory: build diff --git a/.github/workflows/sanitizer.yml b/.github/workflows/sanitizer.yml index b69de875e..e1191aca7 100644 --- a/.github/workflows/sanitizer.yml +++ b/.github/workflows/sanitizer.yml @@ -10,6 +10,10 @@ jobs: strategy: matrix: compiler: [clang++] + id_type: [uint32, uint64] + include: + - id_type: uint64 + id_type_option: -DENTT_BUILD_UINT64=ON runs-on: ubuntu-latest @@ -20,7 +24,7 @@ jobs: env: CXX: ${{ matrix.compiler }} run: | - cmake -DENTT_USE_SANITIZER=ON -DENTT_BUILD_TESTING=ON -DENTT_BUILD_LIB=ON -DENTT_BUILD_EXAMPLE=ON .. + cmake -DENTT_USE_SANITIZER=ON -DENTT_BUILD_TESTING=ON -DENTT_BUILD_LIB=ON -DENTT_BUILD_EXAMPLE=ON ${{ matrix.id_type_option }} .. make -j4 - name: Run tests working-directory: build diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a231f3ce..5c4a90dee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,6 +173,7 @@ if(ENTT_BUILD_TESTING) option(ENTT_BUILD_EXAMPLE "Build examples." OFF) option(ENTT_BUILD_LIB "Build lib tests." OFF) option(ENTT_BUILD_SNAPSHOT "Build snapshot test with Cereal." OFF) + option(ENTT_BUILD_UINT64 "Build using 64b entity identifiers" OFF) include(CTest) enable_testing() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 79e2c8086..15207ea45 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -65,6 +65,14 @@ function(SETUP_TARGET TARGET_NAME) NOMINMAX ${ARGN} ) + + if(ENTT_BUILD_UINT64) + target_compile_definitions( + ${TARGET_NAME} + PRIVATE + ENTT_ID_TYPE=std::uint64_t + ) + endif() endfunction() add_library(odr OBJECT odr.cpp)