Disable unit tests by default to avoid C.I. time out

This commit is contained in:
Christophe 2024-03-05 15:47:05 +01:00
parent 49942a611c
commit 3dd9608252
6 changed files with 96 additions and 32 deletions

View File

@ -50,55 +50,55 @@ jobs:
- name: Run with automagic detection - name: Run with automagic detection
run: | run: |
cmake -S. -B ./build_auto -T ${{matrix.toolkit}} cmake -S. -B ./build_auto -T ${{matrix.toolkit}} -DGLM_BUILD_TESTS=ON
cmake --build ./build_auto --config ${{matrix.config}} cmake --build ./build_auto --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_auto ctest --verbose -C ${{matrix.config}} --test-dir ./build_auto
- name: Run with GLM_FORCE_PURE - name: Run with GLM_FORCE_PURE
run: | run: |
cmake -S. -B ./build_pure_std -T ${{matrix.toolkit}} -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON cmake -S. -B ./build_pure_std -T ${{matrix.toolkit}} -DGLM_BUILD_TESTS=ON -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_pure_std --config ${{matrix.config}} cmake --build ./build_pure_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_pure_std ctest --verbose -C ${{matrix.config}} --test-dir ./build_pure_std
- name: Run with GLM_FORCE_PURE and language extensions - name: Run with GLM_FORCE_PURE and language extensions
run: | run: |
cmake -S. -B ./build_pure_ext -T ${{matrix.toolkit}} -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON cmake -S. -B ./build_pure_ext -T ${{matrix.toolkit}} -DGLM_BUILD_TESTS=ON -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_pure_ext --config ${{matrix.config}} cmake --build ./build_pure_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_pure_ext ctest --verbose -C ${{matrix.config}} --test-dir ./build_pure_ext
- name: Run with GLM_ENABLE_SIMD_SSE2 - name: Run with GLM_ENABLE_SIMD_SSE2
run: | run: |
cmake -S. -B ./build_sse2_std -T ${{matrix.toolkit}} -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON cmake -S. -B ./build_sse2_std -T ${{matrix.toolkit}} -DGLM_BUILD_TESTS=ON -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_sse2_std --config ${{matrix.config}} cmake --build ./build_sse2_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_std ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_std
- name: Run with GLM_ENABLE_SIMD_SSE2 and language extensions - name: Run with GLM_ENABLE_SIMD_SSE2 and language extensions
run: | run: |
cmake -S. -B ./build_sse2_ext -T ${{matrix.toolkit}} -DGLM_ENABLE_SIMD_SSE2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON cmake -S. -B ./build_sse2_ext -T ${{matrix.toolkit}} -DGLM_BUILD_TESTS=ON -DGLM_ENABLE_SIMD_SSE2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_sse2_ext --config ${{matrix.config}} cmake --build ./build_sse2_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_ext ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_ext
- name: Run with GLM_ENABLE_SIMD_AVX - name: Run with GLM_ENABLE_SIMD_AVX
run: | run: |
cmake -S. -B ./build_avx1_std -T ${{matrix.toolkit}} -DGLM_ENABLE_SIMD_AVX=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON cmake -S. -B ./build_avx1_std -T ${{matrix.toolkit}} -DGLM_BUILD_TESTS=ON -DGLM_ENABLE_SIMD_AVX=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_avx1_std --config ${{matrix.config}} cmake --build ./build_avx1_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx1_std ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx1_std
- name: Run with GLM_ENABLE_SIMD_AVX and language extensions - name: Run with GLM_ENABLE_SIMD_AVX and language extensions
run: | run: |
cmake -S. -B ./build_avx1_ext -T ${{matrix.toolkit}} -DGLM_ENABLE_SIMD_AVX=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON cmake -S. -B ./build_avx1_ext -T ${{matrix.toolkit}} -DGLM_BUILD_TESTS=ON -DGLM_ENABLE_SIMD_AVX=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_avx1_ext --config ${{matrix.config}} cmake --build ./build_avx1_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx1_ext ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx1_ext
- name: Run with GLM_ENABLE_SIMD_AVX2 - name: Run with GLM_ENABLE_SIMD_AVX2
run: | run: |
cmake -S. -B ./build_avx2_std -T ${{matrix.toolkit}} -DGLM_ENABLE_SIMD_AVX2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON cmake -S. -B ./build_avx2_std -T ${{matrix.toolkit}} -DGLM_BUILD_TESTS=ON -DGLM_ENABLE_SIMD_AVX2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_avx2_std --config ${{matrix.config}} cmake --build ./build_avx2_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx2_std ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx2_std
- name: Run with GLM_ENABLE_SIMD_AVX2 and language extensions - name: Run with GLM_ENABLE_SIMD_AVX2 and language extensions
run: | run: |
cmake -S. -B ./build_avx2_ext -T ${{matrix.toolkit}} -DGLM_ENABLE_SIMD_AVX2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON cmake -S. -B ./build_avx2_ext -T ${{matrix.toolkit}} -DGLM_BUILD_TESTS=ON -DGLM_ENABLE_SIMD_AVX2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_avx2_ext --config ${{matrix.config}} cmake --build ./build_avx2_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx2_ext ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx2_ext
@ -130,51 +130,51 @@ jobs:
run: cmake --version run: cmake --version
- name: Run with automagic detection - name: Run with automagic detection
run: | run: |
cmake -S. -B ./build_auto cmake -S. -B ./build_auto -DGLM_BUILD_TESTS=ON
cmake --build ./build_auto --config ${{matrix.config}} cmake --build ./build_auto --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_auto ctest --verbose -C ${{matrix.config}} --test-dir ./build_auto
- name: Run with GLM_FORCE_PURE - name: Run with GLM_FORCE_PURE
run: | run: |
cmake -S. -B ./build_pure_std -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON cmake -S. -B ./build_pure_std -DGLM_BUILD_TESTS=ON -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_pure_std --config ${{matrix.config}} cmake --build ./build_pure_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_pure_std ctest --verbose -C ${{matrix.config}} --test-dir ./build_pure_std
- name: Run with GLM_FORCE_PURE and language extensions - name: Run with GLM_FORCE_PURE and language extensions
run: | run: |
cmake -S. -B ./build_pure_ext -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON cmake -S. -B ./build_pure_ext -DGLM_BUILD_TESTS=ON -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_pure_ext --config ${{matrix.config}} cmake --build ./build_pure_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_pure_ext ctest --verbose -C ${{matrix.config}} --test-dir ./build_pure_ext
- name: Run with GLM_ENABLE_SIMD_SSE2 - name: Run with GLM_ENABLE_SIMD_SSE2
run: | run: |
cmake -S. -B ./build_sse2_std -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON cmake -S. -B ./build_sse2_std -DGLM_BUILD_TESTS=ON -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_sse2_std --config ${{matrix.config}} cmake --build ./build_sse2_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_std ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_std
- name: Run with GLM_ENABLE_SIMD_SSE2 and language extensions - name: Run with GLM_ENABLE_SIMD_SSE2 and language extensions
run: | run: |
cmake -S. -B ./build_sse2_ext -DGLM_ENABLE_SIMD_SSE2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON cmake -S. -B ./build_sse2_ext -DGLM_BUILD_TESTS=ON -DGLM_ENABLE_SIMD_SSE2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_sse2_ext --config ${{matrix.config}} cmake --build ./build_sse2_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_ext ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_ext
- name: Run with GLM_ENABLE_SIMD_AVX - name: Run with GLM_ENABLE_SIMD_AVX
run: | run: |
cmake -S. -B ./build_avx1_std -DGLM_ENABLE_SIMD_AVX=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON cmake -S. -B ./build_avx1_std -DGLM_BUILD_TESTS=ON -DGLM_ENABLE_SIMD_AVX=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_avx1_std --config ${{matrix.config}} cmake --build ./build_avx1_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx1_std ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx1_std
- name: Run with GLM_ENABLE_SIMD_AVX and language extensions - name: Run with GLM_ENABLE_SIMD_AVX and language extensions
run: | run: |
cmake -S. -B ./build_avx1_ext -DGLM_ENABLE_SIMD_AVX=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON cmake -S. -B ./build_avx1_ext -DGLM_BUILD_TESTS=ON -DGLM_ENABLE_SIMD_AVX=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_avx1_ext --config ${{matrix.config}} cmake --build ./build_avx1_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx1_ext ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx1_ext
- name: Run with GLM_ENABLE_SIMD_AVX2 - name: Run with GLM_ENABLE_SIMD_AVX2
run: | run: |
cmake -S. -B ./build_avx2_std -DGLM_ENABLE_SIMD_AVX2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON cmake -S. -B ./build_avx2_std -DGLM_BUILD_TESTS=ON -DGLM_ENABLE_SIMD_AVX2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_avx2_std --config ${{matrix.config}} cmake --build ./build_avx2_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx2_std ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx2_std
- name: Run with GLM_ENABLE_SIMD_AVX2 and language extensions - name: Run with GLM_ENABLE_SIMD_AVX2 and language extensions
run: | run: |
cmake -S. -B ./build_avx2_ext -DGLM_ENABLE_SIMD_AVX2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON cmake -S. -B ./build_avx2_ext -DGLM_BUILD_TESTS=ON -DGLM_ENABLE_SIMD_AVX2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_avx2_ext --config ${{matrix.config}} cmake --build ./build_avx2_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx2_ext ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx2_ext
@ -206,40 +206,40 @@ jobs:
run: cmake --version run: cmake --version
- name: Run with automagic detection - name: Run with automagic detection
run: | run: |
cmake -S. -B ./build_auto cmake -S. -B ./build_auto -DGLM_BUILD_TESTS=ON
cmake --build ./build_auto --config ${{matrix.config}} cmake --build ./build_auto --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_auto ctest --verbose -C ${{matrix.config}} --test-dir ./build_auto
- name: Run with GLM_FORCE_PURE - name: Run with GLM_FORCE_PURE
run: | run: |
cmake -S. -B ./build_pure_std -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON cmake -S. -B ./build_pure_std -DGLM_BUILD_TESTS=ON -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_pure_std --config ${{matrix.config}} cmake --build ./build_pure_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_pure_std ctest --verbose -C ${{matrix.config}} --test-dir ./build_pure_std
- name: Run with GLM_FORCE_PURE and language extensions - name: Run with GLM_FORCE_PURE and language extensions
run: | run: |
cmake -S. -B ./build_pure_ext -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON cmake -S. -B ./build_pure_ext -DGLM_BUILD_TESTS=ON -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_pure_ext --config ${{matrix.config}} cmake --build ./build_pure_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_pure_ext ctest --verbose -C ${{matrix.config}} --test-dir ./build_pure_ext
- name: Run with GLM_ENABLE_SIMD_SSE2 - name: Run with GLM_ENABLE_SIMD_SSE2
run: | run: |
cmake -S. -B ./build_sse2_std -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON cmake -S. -B ./build_sse2_std -DGLM_BUILD_TESTS=ON -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_sse2_std --config ${{matrix.config}} cmake --build ./build_sse2_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_std ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_std
- name: Run with GLM_ENABLE_SIMD_SSE2 and language extensions - name: Run with GLM_ENABLE_SIMD_SSE2 and language extensions
run: | run: |
cmake -S. -B ./build_sse2_ext -DGLM_ENABLE_SIMD_SSE2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON cmake -S. -B ./build_sse2_ext -DGLM_BUILD_TESTS=ON -DGLM_ENABLE_SIMD_SSE2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_sse2_ext --config ${{matrix.config}} cmake --build ./build_sse2_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_ext ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_ext
- name: Run with GLM_ENABLE_SIMD_AVX - name: Run with GLM_ENABLE_SIMD_AVX
run: | run: |
cmake -S. -B ./build_avx1_std -DGLM_ENABLE_SIMD_AVX=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON cmake -S. -B ./build_avx1_std -DGLM_BUILD_TESTS=ON -DGLM_ENABLE_SIMD_AVX=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_avx1_std --config ${{matrix.config}} cmake --build ./build_avx1_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx1_std ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx1_std
- name: Run with GLM_ENABLE_SIMD_AVX and language extensions - name: Run with GLM_ENABLE_SIMD_AVX and language extensions
run: | run: |
cmake -S. -B ./build_avx1_ext -DGLM_ENABLE_SIMD_AVX=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON cmake -S. -B ./build_avx1_ext -DGLM_BUILD_TESTS=ON -DGLM_ENABLE_SIMD_AVX=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_avx1_ext --config ${{matrix.config}} cmake --build ./build_avx1_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx1_ext ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx1_ext

View File

@ -21,7 +21,7 @@ if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
endif() endif()
option(GLM_BUILD_LIBRARY "Build dynamic/static library" ON) option(GLM_BUILD_LIBRARY "Build dynamic/static library" ON)
option(GLM_BUILD_TESTS "Build the test programs" ${GLM_IS_MASTER_PROJECT}) option(GLM_BUILD_TESTS "Build the test programs" OFF)
option(GLM_BUILD_INSTALL "Generate the install target" ${GLM_IS_MASTER_PROJECT}) option(GLM_BUILD_INSTALL "Generate the install target" ${GLM_IS_MASTER_PROJECT})
include(GNUInstallDirs) include(GNUInstallDirs)

View File

@ -5,10 +5,9 @@
#define GLM_VERSION_MAJOR 1 #define GLM_VERSION_MAJOR 1
#define GLM_VERSION_MINOR 0 #define GLM_VERSION_MINOR 0
#define GLM_VERSION_PATCH 1 #define GLM_VERSION_PATCH 2
#define GLM_VERSION_REVISION 0 // Deprecated #define GLM_VERSION_REVISION 0 // Deprecated
#define GLM_VERSION 1000 // Deprecated #define GLM_VERSION 1000 // Deprecated
#define GLM_VERSION_MESSAGE "GLM: version 1.0.1"
#define GLM_MAKE_API_VERSION(variant, major, minor, patch) \ #define GLM_MAKE_API_VERSION(variant, major, minor, patch) \
((((uint32_t)(variant)) << 29U) | (((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch))) ((((uint32_t)(variant)) << 29U) | (((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch)))
@ -977,7 +976,7 @@ namespace detail
# define GLM_STR(x) GLM_STR_HELPER(x) # define GLM_STR(x) GLM_STR_HELPER(x)
// Report GLM version // Report GLM version
# pragma message (GLM_STR(GLM_VERSION_MESSAGE)) # pragma message ("GLM: version " GLM_STR(GLM_VERSION_MAJOR) "." GLM_STR(GLM_VERSION_MINOR) "." GLM_STR(GLM_VERSION_PATCH))
// Report C++ language // Report C++ language
# if (GLM_LANG & GLM_LANG_CXX20_FLAG) && (GLM_LANG & GLM_LANG_EXT) # if (GLM_LANG & GLM_LANG_CXX20_FLAG) && (GLM_LANG & GLM_LANG_EXT)

View File

@ -95,7 +95,7 @@ include(FetchContent)
FetchContent_Declare( FetchContent_Declare(
glm glm
GIT_REPOSITORY https://github.com/g-truc/glm.git GIT_REPOSITORY https://github.com/g-truc/glm.git
GIT_TAG bf71a834948186f4097caa076cd2663c69a10e1e #refs/tags/0.9.9.8 GIT_TAG bf71a834948186f4097caa076cd2663c69a10e1e #refs/tags/1.0.1
) )
FetchContent_MakeAvailable(glm) FetchContent_MakeAvailable(glm)
@ -105,6 +105,11 @@ target_link_libraries(main PRIVATE glm::glm)
## Release notes ## Release notes
### [GLM 1.0.2](https://github.com/g-truc/glm/tree/master) - 2024-0X-XX
#### Improvements:
- Unit tests are not build by default, `GLM_BUILD_TESTS` set to `ON` required.
### [GLM 1.0.1](https://github.com/g-truc/glm/releases/tag/1.0.1) - 2024-02-26 ### [GLM 1.0.1](https://github.com/g-truc/glm/releases/tag/1.0.1) - 2024-02-26
#### Features: #### Features:

View File

@ -3,6 +3,10 @@ option(GLM_QUIET "No CMake Message" OFF)
option(GLM_TEST_ENABLE "Build unit tests" ON) option(GLM_TEST_ENABLE "Build unit tests" ON)
option(GLM_PERF_TEST_ENABLE "Build perf tests" OFF) option(GLM_PERF_TEST_ENABLE "Build perf tests" OFF)
if(GLM_PERF_TEST_ENABLE)
add_definitions(-DGLM_TEST_PERF)
endif()
# Compiler and default options # Compiler and default options
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")

View File

@ -20,10 +20,12 @@ namespace mask
# pragma clang diagnostic ignored "-Wsign-conversion" # pragma clang diagnostic ignored "-Wsign-conversion"
#endif #endif
#ifdef GLM_TEST_PERF
static inline int mask_zero(int Bits) static inline int mask_zero(int Bits)
{ {
return ~((~0) << Bits); return ~((~0) << Bits);
} }
#endif//GLM_TEST_PERF
#if GLM_COMPILER & GLM_COMPILER_CLANG #if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push # pragma clang diagnostic push
@ -60,6 +62,7 @@ namespace mask
return Mask; return Mask;
} }
#ifdef GLM_TEST_PERF
static int perf() static int perf()
{ {
int const Count = 1000; int const Count = 1000;
@ -125,6 +128,7 @@ namespace mask
return TimeDefault <= TimeLoop ? 0 : 1; return TimeDefault <= TimeLoop ? 0 : 1;
} }
#endif//GLM_TEST_PERF
#if GLM_COMPILER & GLM_COMPILER_CLANG #if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic pop # pragma clang diagnostic pop
@ -208,6 +212,7 @@ namespace mask
} }
}//namespace mask }//namespace mask
#ifdef GLM_TEST_PERF
namespace bitfieldInterleave3 namespace bitfieldInterleave3
{ {
template<typename PARAM, typename RET> template<typename PARAM, typename RET>
@ -227,6 +232,8 @@ namespace bitfieldInterleave3
{ {
int Error(0); int Error(0);
std::clock_t const LastTime = std::clock();
glm::uint16 const test_max = 5; // previously 11 glm::uint16 const test_max = 5; // previously 11
glm::uint16 x_max = 1 << test_max; glm::uint16 x_max = 1 << test_max;
@ -242,6 +249,10 @@ namespace bitfieldInterleave3
Error += ResultA == ResultB ? 0 : 1; Error += ResultA == ResultB ? 0 : 1;
} }
std::clock_t const Time = std::clock() - LastTime;
std::printf("glm::bitfieldInterleave3 Test %d clocks\n", static_cast<int>(Time));
return Error; return Error;
} }
} }
@ -267,6 +278,8 @@ namespace bitfieldInterleave4
{ {
int Error(0); int Error(0);
std::clock_t const LastTime = std::clock();
glm::uint16 const test_max = 5; // previously 11 glm::uint16 const test_max = 5; // previously 11
glm::uint16 x_max = 1 << test_max; glm::uint16 x_max = 1 << test_max;
@ -284,12 +297,18 @@ namespace bitfieldInterleave4
Error += ResultA == ResultB ? 0 : 1; Error += ResultA == ResultB ? 0 : 1;
} }
std::clock_t const Time = std::clock() - LastTime;
std::printf("glm::bitfieldInterleave4 Test %d clocks\n", static_cast<int>(Time));
return Error; return Error;
} }
} }
#endif//GLM_TEST_PERF
namespace bitfieldInterleave namespace bitfieldInterleave
{ {
#ifdef GLM_TEST_PERF
static inline glm::uint64 fastBitfieldInterleave(glm::uint32 x, glm::uint32 y) static inline glm::uint64 fastBitfieldInterleave(glm::uint32 x, glm::uint32 y)
{ {
glm::uint64 REG1; glm::uint64 REG1;
@ -495,11 +514,13 @@ namespace bitfieldInterleave
#endif #endif
} }
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
#endif//GLM_TEST_PERF
static int test() static int test()
{ {
int Error = 0; int Error = 0;
std::clock_t const LastTime = std::clock();
glm::uint8 const test_loop = 15; // 127 ideally glm::uint8 const test_loop = 15; // 127 ideally
/* /*
@ -560,9 +581,14 @@ namespace bitfieldInterleave
} }
} }
std::clock_t const Time = std::clock() - LastTime;
std::printf("glm::bitfieldInterleave Test %d clocks\n", static_cast<int>(Time));
return Error; return Error;
} }
#ifdef GLM_TEST_PERF
static int perf() static int perf()
{ {
glm::uint32 x_max = 1 << 4; glm::uint32 x_max = 1 << 4;
@ -677,8 +703,10 @@ namespace bitfieldInterleave
return 0; return 0;
} }
#endif//GLM_TEST_PERF
}//namespace bitfieldInterleave }//namespace bitfieldInterleave
#ifdef GLM_TEST_PERF
namespace bitfieldInterleave5 namespace bitfieldInterleave5
{ {
GLM_FUNC_QUALIFIER GLM_FUNC_QUALIFIER
@ -764,6 +792,8 @@ namespace bitfieldInterleave5
{ {
int Error = 0; int Error = 0;
std::clock_t const LastTime = std::clock();
glm::size_t count = 256 / divider; glm::size_t count = 256 / divider;
for(glm::size_t j = 0; j < count; ++j) for(glm::size_t j = 0; j < count; ++j)
@ -803,6 +833,10 @@ namespace bitfieldInterleave5
Error += A == B ? 0 : 1; Error += A == B ? 0 : 1;
} }
*/ */
std::clock_t const Time = std::clock() - LastTime;
std::printf("glm::bitfieldInterleave4 Test %d clocks\n", static_cast<int>(Time));
return Error; return Error;
} }
@ -962,22 +996,34 @@ namespace bitfieldInterleave5
return Error; return Error;
} }
}//namespace bitfieldInterleave5 }//namespace bitfieldInterleave5
#endif//GLM_TEST_PERF
static int test_bitfieldRotateRight() static int test_bitfieldRotateRight()
{ {
std::clock_t const LastTime = std::clock();
glm::ivec4 const A = glm::bitfieldRotateRight(glm::ivec4(2), 1); glm::ivec4 const A = glm::bitfieldRotateRight(glm::ivec4(2), 1);
glm::ivec4 const B = glm::ivec4(2) >> 1; glm::ivec4 const B = glm::ivec4(2) >> 1;
std::clock_t const Time = std::clock() - LastTime;
std::printf("glm::bitfieldRotateRight Test %d clocks\n", static_cast<int>(Time));
return A == B; return A == B;
} }
static int test_bitfieldRotateLeft() static int test_bitfieldRotateLeft()
{ {
std::clock_t const LastTime = std::clock();
glm::ivec4 const A = glm::bitfieldRotateLeft(glm::ivec4(2), 1); glm::ivec4 const A = glm::bitfieldRotateLeft(glm::ivec4(2), 1);
glm::ivec4 const B = glm::ivec4(2) << 1; glm::ivec4 const B = glm::ivec4(2) << 1;
std::clock_t const Time = std::clock() - LastTime;
std::printf("glm::bitfieldRotateLeft Test %d clocks\n", static_cast<int>(Time));
return A == B; return A == B;
} }
@ -986,6 +1032,9 @@ int main()
int Error = 0; int Error = 0;
Error += ::bitfieldInterleave::test(); Error += ::bitfieldInterleave::test();
#ifdef GLM_TEST_PERF
Error += ::bitfieldInterleave3::test(); Error += ::bitfieldInterleave3::test();
Error += ::bitfieldInterleave4::test(); Error += ::bitfieldInterleave4::test();
@ -995,9 +1044,16 @@ int main()
Error += ::bitfieldInterleave::perf(); Error += ::bitfieldInterleave::perf();
#endif//GLM_TEST_PERF
Error += ::mask::test(); Error += ::mask::test();
#ifdef GLM_TEST_PERF
Error += ::mask::perf(); Error += ::mask::perf();
#endif//GLM_TEST_PERF
Error += test_bitfieldRotateRight(); Error += test_bitfieldRotateRight();
Error += test_bitfieldRotateLeft(); Error += test_bitfieldRotateLeft();