IAS 23.8 says "an entity shall capitalise borrowing costs that are directly attributable to the acquisition, construction or production of a qualifying asset as part of the cost of that asset. An entity shall recognise other borrowing costs as an expense in the period in which it incurs them.
an asset that necessarily takes a substantial period of time to get ready for its intended use or sale”.
Also note IAS 23.5 "a qualifying asset is an asset that necessarily takes a substantial period of
time to get ready for its intended use or sale"
The phrase "substantial period" is not defined in the standard, but in practice, a period in excess of one year could be considered as a substantial period. As per your explanation, a warehouse is very likely to be a qualifying asset and therefore the interest costs can be capitalized.
Also note IAS 23.10 "The borrowing costs that are directly attributable to the acquisition, construction or production of a qualifying asset are those borrowing costs that would have been avoided if the expenditure on the qualifying asset had not been made. When an entity borrows funds specifically for the purpose of obtaining a particular qualifying asset, the borrowing costs that directly relate to that qualifying asset can be readily identified."
However the capitalization should cease when substantially all the activities necessary to prepare the qualifying asset for its intended use or sale are complete (IAS 23.22).