Mercurial > vec
annotate CMakeLists.txt @ 21:697b9ba1c1de
impl/ppc/altivec: implement comparison functions
had to prune some up eh, vec_cmple/vec_cmpge is only available in
VSX
| author | Paper <paper@tflc.us> | 
|---|---|
| date | Thu, 21 Nov 2024 21:55:20 +0000 | 
| parents | 41dd962abdd1 | 
| children | e26874655738 | 
| rev | line source | 
|---|---|
| 
17
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
1 cmake_minimum_required(VERSION 3.23) | 
| 
8
 
6e0eb3aa12ab
build: add files to build vec as an external library
 
Paper <paper@tflc.us> 
parents:  
diff
changeset
 | 
2 | 
| 
15
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
3 project(vec VERSION 2.0.0 DESCRIPTION "a tiny C99 SIMD vector library") | 
| 
8
 
6e0eb3aa12ab
build: add files to build vec as an external library
 
Paper <paper@tflc.us> 
parents:  
diff
changeset
 | 
4 | 
| 
 
6e0eb3aa12ab
build: add files to build vec as an external library
 
Paper <paper@tflc.us> 
parents:  
diff
changeset
 | 
5 add_library(vec SHARED src/vec.c) | 
| 
 
6e0eb3aa12ab
build: add files to build vec as an external library
 
Paper <paper@tflc.us> 
parents:  
diff
changeset
 | 
6 | 
| 
17
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
7 target_sources(vec PUBLIC | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
8 $<INSTALL_INTERFACE:vec/vec.h> | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
9 $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/vec/vec.h> | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
10 $<INSTALL_INTERFACE:vec/impl/integer.h> | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
11 $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include/vec/impl/integer.h> | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
12 ) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
13 | 
| 
15
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
14 include(CheckCCompilerFlag) | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
15 | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
16 if(MSVC) | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
17 # TODO ? | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
18 else() | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
19 check_c_compiler_flag("-maltivec" COMPILER_HAS_ALTIVEC) | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
20 if(COMPILER_HAS_ALTIVEC) | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
21 target_compile_options(vec PRIVATE "-maltivec") | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
22 endif() | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
23 check_c_compiler_flag("-mmmx" COMPILER_HAS_MMX) | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
24 if(COMPILER_HAS_MMX) | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
25 target_compile_options(vec PRIVATE "-mmmx") | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
26 endif() | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
27 check_c_compiler_flag("-msse2" COMPILER_HAS_SSE2) | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
28 if(COMPILER_HAS_SSE2) | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
29 target_compile_options(vec PRIVATE "-msse2") | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
30 endif() | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
31 check_c_compiler_flag("-msse4.1" COMPILER_HAS_SSE41) | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
32 if(COMPILER_HAS_SSE41) | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
33 target_compile_options(vec PRIVATE "-msse4.1") | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
34 endif() | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
35 check_c_compiler_flag("-mavx2" COMPILER_HAS_AVX2) | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
36 if(COMPILER_HAS_AVX2) | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
37 target_compile_options(vec PRIVATE "-mavx2") | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
38 endif() | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
39 check_c_compiler_flag("-mavx512f" COMPILER_HAS_AVX512F) | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
40 if(COMPILER_HAS_AVX512F) | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
41 target_compile_options(vec PRIVATE "-mavx512f") | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
42 endif() | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
43 endif() | 
| 
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
44 | 
| 
17
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
45 ######################################################################### | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
46 # integer types | 
| 
15
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
47 | 
| 
17
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
48 include(CheckTypeSize) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
49 | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
50 check_type_size("int16_t" INT16_T_SIZE LANGUAGE C) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
51 check_type_size("uint16_t" UINT16_T_SIZE LANGUAGE C) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
52 check_type_size("u_int16_t" U_INT16_T_SIZE LANGUAGE C) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
53 check_type_size("int32_t" INT32_T_SIZE LANGUAGE C) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
54 check_type_size("uint32_t" UINT32_T_SIZE LANGUAGE C) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
55 check_type_size("u_int32_t" U_INT32_T_SIZE LANGUAGE C) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
56 check_type_size("int64_t" INT64_T_SIZE LANGUAGE C) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
57 check_type_size("uint64_t" UINT64_T_SIZE LANGUAGE C) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
58 check_type_size("u_int64_t" U_INT64_T_SIZE LANGUAGE C) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
59 check_type_size("short" SHORT_SIZE LANGUAGE C) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
60 check_type_size("int" INT_SIZE LANGUAGE C) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
61 check_type_size("long" LONG_SIZE LANGUAGE C) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
62 check_type_size("long long" LONG_LONG_SIZE LANGUAGE C) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
63 check_type_size("uintptr_t" UINTPTR_T_SIZE LANGUAGE C) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
64 | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
65 if(INT16_T_SIZE EQUAL 2) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
66 set(SIZE16 "int16_t") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
67 elseif(SHORT_SIZE EQUAL 2) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
68 set(SIZE16 "short") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
69 elseif(INT_SIZE EQUAL 2) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
70 set(SIZE16 "int") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
71 endif() | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
72 | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
73 if(UINT16_T_SIZE EQUAL 2) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
74 set(USIZE16 "uint16_t") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
75 elseif(U_INT16_T_SIZE EQUAL 2) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
76 set(USIZE16 "u_int16_t") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
77 elseif(SHORT_SIZE EQUAL 2) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
78 set(USIZE16 "unsigned short") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
79 elseif(INT_SIZE EQUAL 2) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
80 set(USIZE16 "unsigned int") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
81 endif() | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
82 | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
83 if(INT32_T_SIZE EQUAL 4) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
84 set(SIZE32 "int32_t") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
85 elseif(SHORT_SIZE EQUAL 4) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
86 set(SIZE32 "short") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
87 elseif(INT_SIZE EQUAL 4) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
88 set(SIZE32 "int") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
89 elseif(LONG_SIZE EQUAL 4) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
90 set(SIZE32 "long") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
91 endif() | 
| 
8
 
6e0eb3aa12ab
build: add files to build vec as an external library
 
Paper <paper@tflc.us> 
parents:  
diff
changeset
 | 
92 | 
| 
17
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
93 if(UINT32_T_SIZE EQUAL 4) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
94 set(USIZE32 "uint32_t") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
95 elseif(U_INT32_T_SIZE EQUAL 4) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
96 set(USIZE32 "u_int32_t") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
97 elseif(SHORT_SIZE EQUAL 4) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
98 set(USIZE32 "unsigned short") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
99 elseif(INT_SIZE EQUAL 4) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
100 set(USIZE32 "unsigned int") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
101 elseif(LONG_SIZE EQUAL 4) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
102 set(USIZE32 "unsigned long") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
103 endif() | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
104 | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
105 if(INT64_T_SIZE EQUAL 8) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
106 set(SIZE64 "int64_t") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
107 elseif(SHORT_SIZE EQUAL 8) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
108 set(SIZE64 "short") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
109 elseif(INT_SIZE EQUAL 8) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
110 set(SIZE64 "int") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
111 elseif(LONG_SIZE EQUAL 8) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
112 set(SIZE64 "long") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
113 elseif(LONG_LONG_SIZE EQUAL 8) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
114 set(SIZE64 "long long") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
115 endif() | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
116 | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
117 if(UINT64_T_SIZE EQUAL 8) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
118 set(USIZE64 "uint64_t") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
119 elseif(U_INT64_T_SIZE EQUAL 8) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
120 set(USIZE64 "u_int64_t") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
121 elseif(SHORT_SIZE EQUAL 8) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
122 set(USIZE64 "unsigned short") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
123 elseif(INT_SIZE EQUAL 8) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
124 set(USIZE64 "unsigned int") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
125 elseif(LONG_SIZE EQUAL 8) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
126 set(USIZE64 "unsigned long") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
127 elseif(LONG_LONG_SIZE EQUAL 8) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
128 set(USIZE64 "unsigned long long") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
129 endif() | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
130 | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
131 if(CMAKE_SIZEOF_VOID_P EQUAL UINTPTR_T_SIZE) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
132 set(USIZEPTR "uintptr_t") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
133 elseif(CMAKE_SIZEOF_VOID_P EQUAL 1) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
134 set(USIZEPTR "unsigned char") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
135 elseif(CMAKE_SIZEOF_VOID_P EQUAL 2) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
136 set(USIZEPTR "${USIZE16}") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
137 elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
138 set(USIZEPTR "${USIZE32}") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
139 elseif(CMAKE_SIZEOF_VOID_P EQUAL 8) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
140 set(USIZEPTR "${USIZE64}") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
141 endif() | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
142 | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
143 configure_file(include/vec/impl/integer.h.in include/vec/impl/integer.h @ONLY) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
144 | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
145 target_compile_definitions(vec PRIVATE "VEC_HAVE_IMPL_INTEGER_H") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
146 | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
147 ######################################################################### | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
148 | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
149 target_compile_features(vec PRIVATE $<IF:$<COMPILE_FEATURES:c_std_11>,c_std_11,c_std_99>) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
150 target_include_directories(vec PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include;${CMAKE_CURRENT_BINARY_DIR}/include/vec") | 
| 
8
 
6e0eb3aa12ab
build: add files to build vec as an external library
 
Paper <paper@tflc.us> 
parents:  
diff
changeset
 | 
151 | 
| 
 
6e0eb3aa12ab
build: add files to build vec as an external library
 
Paper <paper@tflc.us> 
parents:  
diff
changeset
 | 
152 # Installing | 
| 
 
6e0eb3aa12ab
build: add files to build vec as an external library
 
Paper <paper@tflc.us> 
parents:  
diff
changeset
 | 
153 | 
| 
 
6e0eb3aa12ab
build: add files to build vec as an external library
 
Paper <paper@tflc.us> 
parents:  
diff
changeset
 | 
154 include(GNUInstallDirs) | 
| 
 
6e0eb3aa12ab
build: add files to build vec as an external library
 
Paper <paper@tflc.us> 
parents:  
diff
changeset
 | 
155 | 
| 
17
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
156 install(TARGETS vec LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
157 | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
158 install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/include/vec/vec.h" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/vec") | 
| 
 
41dd962abdd1
*: allow compiling vec in a C++ translation unit
 
Paper <paper@tflc.us> 
parents: 
15 
diff
changeset
 | 
159 install(FILES "${CMAKE_CURRENT_BINARY_DIR}/include/vec/impl/integer.h" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/vec/impl") | 
| 
8
 
6e0eb3aa12ab
build: add files to build vec as an external library
 
Paper <paper@tflc.us> 
parents:  
diff
changeset
 | 
160 | 
| 
 
6e0eb3aa12ab
build: add files to build vec as an external library
 
Paper <paper@tflc.us> 
parents:  
diff
changeset
 | 
161 # pkg-config | 
| 
 
6e0eb3aa12ab
build: add files to build vec as an external library
 
Paper <paper@tflc.us> 
parents:  
diff
changeset
 | 
162 configure_file(vec.pc.in vec.pc @ONLY) | 
| 
15
 
e05c257c6a23
*: huge refactor, add many new x86 intrinsics and the like
 
Paper <paper@tflc.us> 
parents: 
8 
diff
changeset
 | 
163 install(FILES ${CMAKE_BINARY_DIR}/vec.pc DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig) | 
