Skip to content

Commit 401de47

Browse files
committed
use target_compile_definitions for TINYOBJLOADER_USE_DOUBLE to avoid the need for defining again in downstream
1 parent e0beb00 commit 401de47

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ set(TINYOBJLOADER_VERSION 1.0.4)
1010
option(TINYOBJLOADER_USE_DOUBLE "Build library with double precision instead of single (float)" OFF)
1111

1212
if(TINYOBJLOADER_USE_DOUBLE)
13-
add_definitions(-DTINYOBJLOADER_USE_DOUBLE)
1413
set(LIBRARY_NAME ${PROJECT_NAME}_double)
1514
else()
1615
set(LIBRARY_NAME ${PROJECT_NAME})
@@ -56,6 +55,10 @@ if(BUILD_SHARED_LIBS)
5655
)
5756
endif()
5857

58+
if(TINYOBJLOADER_USE_DOUBLE)
59+
target_compile_definitions(${LIBRARY_NAME} PUBLIC TINYOBJLOADER_USE_DOUBLE)
60+
endif()
61+
5962
set_target_properties(${LIBRARY_NAME} PROPERTIES VERSION ${TINYOBJLOADER_VERSION})
6063

6164
target_include_directories(${LIBRARY_NAME} INTERFACE

0 commit comments

Comments
 (0)