mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-20 02:25:53 +00:00
Improve subproj handling and deprecated target options:
Exclude several libraries from build when we are included in a super-project (this is the case when someone only wants to use xrpl_core). Force several target (deprecated) params to be cache variables since they are now exposed as options.
This commit is contained in:
@@ -50,11 +50,11 @@ macro(parse_target)
|
||||
endif()
|
||||
|
||||
if (${cur_component} STREQUAL unity)
|
||||
set(unity true)
|
||||
set(unity ON CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
if (${cur_component} STREQUAL nounity)
|
||||
set(unity false)
|
||||
set(unity OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
if (${cur_component} STREQUAL debug)
|
||||
@@ -66,12 +66,12 @@ macro(parse_target)
|
||||
endif()
|
||||
|
||||
if (${cur_component} STREQUAL coverage)
|
||||
set(coverage true)
|
||||
set(coverage ON CACHE BOOL "" FORCE)
|
||||
set(debug true)
|
||||
endif()
|
||||
|
||||
if (${cur_component} STREQUAL profile)
|
||||
set(profile true)
|
||||
set(profile ON CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
endwhile()
|
||||
endif()
|
||||
@@ -108,3 +108,10 @@ macro(group_sources curdir)
|
||||
group_sources_in(${PROJECT_SOURCE_DIR} ${curdir})
|
||||
endmacro()
|
||||
|
||||
macro (exclude_if_included target_)
|
||||
if (NOT ${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
|
||||
set_target_properties (${target_} PROPERTIES EXCLUDE_FROM_ALL ON)
|
||||
set_target_properties (${target_} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON)
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user