Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c2f194a

Browse files
authored
Merge pull request tinyobjloader#238 from jasjuang/master
use target_compile_definitions for TINYOBJLOADER_USE_DOUBLE
2 parents e0beb00 + 401de47 commit c2f194a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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)