Changeset 3250 for trunk/kBuild/units


Ignore:
Timestamp:
Dec 28, 2018, 11:43:52 PM (7 years ago)
Author:
bird
Message:

Working on precompiled headers for GCC.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/units/gccprecomp.kmk

    r3247 r3250  
    11# $Id$
    22## @file
    3 # kBuild Unit - Target Level Precompiled Headers for Visual C++.
     3# kBuild Unit - Target Level Precompiled Headers for GNU GCC.
    44#
    55
     
    3333
    3434
    35 UNIT_vccprecomp = Target level precompiled Headers for Visual C++
     35UNIT_gccprecomp = Target level precompiled Headers for Visual C++
    3636
    3737#
    3838# Early target processing pass #1.
    3939#
    40 # This set the internal _VCC_PCH_FILE and VCC_COMMON_OBJ_PDB properties,
    41 # which will be picked up by the VCCxxx tool.
     40# This sets $(target)_1_GCC_PCH_DIR as the include directory for the precompiled
     41# header, adding it to BLDDIRS to get a mkdir rule for it, and then calculates the
     42# .gch name and stores that in $(target)_1_GCC_PCH_FILE for compile rule dependencies.
    4243#
    43 define def_unit_vccprecomp_target_pre
    44  $(target)_1_VCC_PCH_FILE       := $(outbase)-pch.pch
    45  $(target)_1_VCC_COMMON_OBJ_PDB := $(outbase)-common-obj.pdb
     44define def_unit_gccprecomp_target_pre
     45 $(target)_BLDDIRS        += $($(target)_0_OUTDIR)/pch/
     46 $(target)_1_GCC_PCH_DIR  := $($(target)_0_OUTDIR)/pch/
     47 $(target)_1_GCC_PCH_FILE := $($(target)_0_OUTDIR)/pch/$(notdir $($(target)_PCH_HDR)).gch
    4648endef
    4749
     
    4951# Early target processing pass #2.
    5052#
    51 # This sets up a rule for creating the .pch file after qt5 and similar units
     53# This sets up a rule for creating the .gch file after qt5 and similar units
    5254# are done modifying INCS, DEFS and company.  The 'tool' variable is defined by
    5355# footer-pass2-compiling-targets.kmk and is really the LD tool, but that'll
    54 # have to do for now.  The '-PCH' variant of the VCC tool, is defined together
     56# have to do for now.  The '-PCH' variant of the GCC/LLVM tool, is defined together
    5557# with $(tool) and allow us to bypass the options and dependencies triggered
    5658# by _1_VCC_PCH_FILE, _1_VCC_COMMON_OBJ_PDB and _PCH_HDR, and also make sure we
    5759# don't get circular dependencies by way of kDepObj and the debug info.
    5860#
    59 define def_unit_vccprecomp_target_pre_2
     61define def_unit_gccprecomp_target_pre_2
    6062 local source := $($(target)_PCH_HDR)
    61  $(source)_TOOL := $(tool)-PCH
    6263 local suff   := $(suffix $(source))
    63  local type   := CXX
     64 local type   := PCH
    6465 $(kb-src-one 2)
    6566endef
Note: See TracChangeset for help on using the changeset viewer.