Skip to content

Commit 690f9f6

Browse files
committed
Explicitly turn off PCH for builtin resources (could inherit a setup causing it to generate another 500 MB .pch), do not link Nabla nor add it as dependency to builtin resources if not internal (old code bug causing extra dependency chain, they only need single Nabla headers to build)
1 parent 9656f25 commit 690f9f6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

cmake/common.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -966,11 +966,11 @@ endfunction()
966966
# @_BS_TARGET_@ is a builtin resource target
967967

968968
function(LINK_BUILTIN_RESOURCES_TO_TARGET _TARGET_ _BS_TARGET_)
969-
add_dependencies(${EXECUTABLE_NAME} ${_BS_TARGET_})
970-
target_link_libraries(${EXECUTABLE_NAME} PUBLIC ${_BS_TARGET_})
969+
add_dependencies(${_TARGET_} ${_BS_TARGET_})
970+
target_link_libraries(${_TARGET_} PUBLIC ${_BS_TARGET_})
971971

972972
get_target_property(_BUILTIN_RESOURCES_INCLUDE_SEARCH_DIRECTORY_ ${_BS_TARGET_} BUILTIN_RESOURCES_INCLUDE_SEARCH_DIRECTORY)
973-
target_include_directories(${EXECUTABLE_NAME} PUBLIC "${_BUILTIN_RESOURCES_INCLUDE_SEARCH_DIRECTORY_}")
973+
target_include_directories(${_TARGET_} PUBLIC "${_BUILTIN_RESOURCES_INCLUDE_SEARCH_DIRECTORY_}")
974974
endfunction()
975975

976976
macro(nbl_android_create_apk _TARGET)

src/nbl/builtin/utils.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ function(ADD_CUSTOM_BUILTIN_RESOURCES _TARGET_NAME_ _BUNDLE_NAME_ _BUNDLE_SEARCH
156156
"${_OUTPUT_HEADER_DIRECTORY_}/CArchive.h"
157157
)
158158

159+
set_target_properties(${_TARGET_NAME_} PROPERTIES
160+
DISABLE_PRECOMPILE_HEADERS ON
161+
)
162+
159163
if(_LIB_TYPE_ STREQUAL SHARED)
160164
target_compile_definitions(${_TARGET_NAME_}
161165
PRIVATE __NBL_BUILDING_TARGET__
@@ -168,10 +172,6 @@ function(ADD_CUSTOM_BUILTIN_RESOURCES _TARGET_NAME_ _BUNDLE_NAME_ _BUNDLE_SEARCH
168172
if(NBL_STATIC_BUILD AND _LIB_TYPE_ STREQUAL SHARED)
169173
message(FATAL_ERROR "Nabla must be built as dynamic library in order to combine this tool with SHARED setup!")
170174
endif()
171-
172-
if(NOT _NBL_INTERNAL_BR_CREATION_)
173-
target_link_libraries(${_TARGET_NAME_} Nabla) # be aware Nabla must be linked to the BRs
174-
endif()
175175
endif()
176176

177177
if(NOT DEFINED _NABLA_INCLUDE_DIRECTORIES_) # TODO, validate by populating generator expressions if any and checking whether a path to the BuildConfigOptions.h exists per config

0 commit comments

Comments
 (0)