File: build-cpp

package info (click to toggle)
tinyobjloader 2.0.0~rc13%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,488 kB
  • sloc: cpp: 7,029; python: 120; sh: 57; makefile: 45
file content (41 lines) | stat: -rwxr-xr-x 1,054 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
cd "$AUTOPKGTEST_TMP"

cat >"CMakeLists.txt" <<EOF
cmake_minimum_required(VERSION 3.13...3.26)
project(test_tinyobjloader)

find_package(tinyobjloader REQUIRED)

add_executable(test_float test.cpp)
target_link_libraries(test_float tinyobjloader::tinyobjloader)
target_compile_definitions(test_float PRIVATE EXPECTED_TYPE=float)

add_executable(test_double test.cpp)
target_link_libraries(test_double tinyobjloader::tinyobjloader_double)
target_compile_definitions(test_double PRIVATE EXPECTED_TYPE=double)
EOF

cat >"test.cpp" << EOF
#include <tiny_obj_loader.h>
#include <type_traits>

int main (int argc, char** argv)
{
	tinyobj::attrib_t attrib;
	std::vector<tinyobj::shape_t> shapes;
	std::vector<tinyobj::material_t> materials;
	std::string warn;
	std::string err;

	static_assert(std::is_same<tinyobj::real_t, EXPECTED_TYPE>::value, "wrong floating point preision");

	bool ok = tinyobj::LoadObj(&attrib, &shapes, &materials, &warn, &err, "some.obj");
	return 0;
}
EOF
echo '$' cmake .
cmake .
echo '$' make VERBOSE=ON
make VERBOSE=ON