Re-introduced the custom build defines
The ability to use custom build defines were removed in commit:
1c5a0bb325
This commit will reintroduce this feature, but using a prefixed variable
name.
This commit is contained in:
parent
91fde92fc2
commit
0f1e75a902
@ -23,6 +23,9 @@ cmake_dependent_option(PUGIXML_BUILD_TESTS
|
|||||||
"Build pugixml tests" OFF
|
"Build pugixml tests" OFF
|
||||||
"BUILD_TESTING;CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF)
|
"BUILD_TESTING;CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF)
|
||||||
|
|
||||||
|
# Custom build defines
|
||||||
|
set(PUGIXML_BUILD_DEFINES CACHE STRING "Build defines")
|
||||||
|
|
||||||
option(PUGIXML_BUILD_SHARED_AND_STATIC_LIBS "Build both shared and static libraries" OFF)
|
option(PUGIXML_BUILD_SHARED_AND_STATIC_LIBS "Build both shared and static libraries" OFF)
|
||||||
|
|
||||||
# Expose option to build PUGIXML as static even when the global BUILD_SHARED_LIBS variable is set
|
# Expose option to build PUGIXML as static even when the global BUILD_SHARED_LIBS variable is set
|
||||||
@ -44,6 +47,12 @@ if (NOT DEFINED CMAKE_CXX_STANDARD)
|
|||||||
set(CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (DEFINED PUGIXML_BUILD_DEFINES)
|
||||||
|
foreach(DEFINE ${PUGIXML_BUILD_DEFINES})
|
||||||
|
add_definitions("-D" ${DEFINE})
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
if (PUGIXML_USE_POSTFIX)
|
if (PUGIXML_USE_POSTFIX)
|
||||||
set(CMAKE_RELWITHDEBINFO_POSTFIX _r)
|
set(CMAKE_RELWITHDEBINFO_POSTFIX _r)
|
||||||
set(CMAKE_MINSIZEREL_POSTFIX _m)
|
set(CMAKE_MINSIZEREL_POSTFIX _m)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user