Skip to content

Commit

Permalink
Unify Clang and GCC PCH creation (#70)
Browse files Browse the repository at this point in the history
Clang has GCC-compatible PCH generation interface, no need to override and re-implement PCH generation in Clang at all.
  • Loading branch information
Kojoley committed Aug 4, 2021
1 parent 4380676 commit 6dda409
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 25 deletions.
10 changes: 0 additions & 10 deletions src/tools/clang-darwin.jam
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,6 @@ actions compile.c++ bind PCH_FILE
"$(CONFIG_COMMAND)" -x c++ $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" $(.include-pch)"$(PCH_FILE)" -c -o "$(<)" "$(>)"
}

actions compile.c.pch
{
"$(CONFIG_COMMAND)" -x c-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -o "$(<)" "$(>)"
}

actions compile.c++.pch
{
"$(CONFIG_COMMAND)" -c -x c++-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -o "$(<)" "$(>)"
}

# Declare actions for linking
rule link ( targets * : sources * : properties * )
{
Expand Down
13 changes: 0 additions & 13 deletions src/tools/clang-linux.jam
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,6 @@ actions compile.c bind PCH_FILE
"$(CONFIG_COMMAND)" -c -x c $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang$(_)-include-pch$(_)-Xclang$(_)"$(PCH_FILE)" -include"$(FORCE_INCLUDES)" -c -o "$(<)" "$(>)"
}

###############################################################################
# PCH emission

actions compile.c++.pch
{
"$(CONFIG_COMMAND)" -c -x c++-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -include"$(FORCE_INCLUDES)" -Xclang -emit-pch -o "$(<)" "$(>)"
}

actions compile.c.pch
{
"$(CONFIG_COMMAND)" -c -x c-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -include"$(FORCE_INCLUDES)" -Xclang -emit-pch -o "$(<)" "$(>)"
}

###############################################################################
# Linking

Expand Down
4 changes: 2 additions & 2 deletions src/tools/gcc.jam
Original file line number Diff line number Diff line change
Expand Up @@ -608,12 +608,12 @@ toolset.flags gcc.compile PCH_FILE <pch>on : <pch-file> ;

actions compile.c++.pch
{
"$(CONFIG_COMMAND)" -x c++-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
"$(CONFIG_COMMAND)" -x c++-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -include"$(FORCE_INCLUDES)" -c -o "$(<)" "$(>)"
}

actions compile.c.pch
{
"$(CONFIG_COMMAND)" -x c-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
"$(CONFIG_COMMAND)" -x c-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -include"$(FORCE_INCLUDES)" -c -o "$(<)" "$(>)"
}

###
Expand Down

0 comments on commit 6dda409

Please sign in to comment.