mirror of
https://git.mirrors.martin98.com/https://github.com/google/draco
synced 2025-08-10 04:48:57 +08:00
draco: Fix add_cxx_preproc_definition() behavior/usage to support setting multiple opts
- Prev, only last option would take/be appended ... results in needing to run build bunches of times and exploding the CMAKE_CXX_FLAGS variable - We also no longer cache those definitions, keeping them localized - Ref: https://github.com/google/draco/issues/306 for related discussion - Linked fix uses CMake add_definitions() function, but this applies to both C and C++-based compilation
This commit is contained in:
parent
0438f97edf
commit
85cbcbf7b0
@ -152,8 +152,7 @@ function (add_cxx_preproc_definition preproc_def)
|
||||
string(FIND "${CMAKE_CXX_FLAGS}" "${preproc_def}" PREPROC_DEF_FOUND)
|
||||
|
||||
if (${PREPROC_DEF_FOUND} EQUAL -1)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D${preproc_def}" CACHE STRING ""
|
||||
FORCE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D${preproc_def}" PARENT_SCOPE)
|
||||
endif ()
|
||||
endfunction ()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user