Skip to content
Permalink
Browse files

Merge pull request #13055 from permcody/header_symlinks

Allow users to turn off header symlinking
  • Loading branch information...
aeslaughter committed Mar 14, 2019
2 parents 2bc94c4 + 53b5a0d commit 90487ec0f681e1bd36c6b68e765d13da5aab1a31
Showing with 28 additions and 9 deletions.
  1. +15 −8 framework/app.mk
  2. +10 −1 framework/moose.mk
  3. +3 −0 modules/doc/content/application_development/build_system.md
@@ -158,10 +158,6 @@ ifneq ($(wildcard $(APPLICATION_DIR)/test/include/*),)
depend_dirs += $(APPLICATION_DIR)/test/include
endif

# header files
include_dirs := $(shell find $(depend_dirs) -type d)
include_files := $(shell find $(depend_dirs) -regex "[^\#~]*\.[hf]")

# clang static analyzer files
app_analyzer := $(patsubst %.C, %.plist.$(obj-suffix), $(srcfiles))

@@ -178,18 +174,29 @@ else
app_test_LIB := $(APPLICATION_DIR)/test/lib/lib$(APPLICATION_NAME)_test-$(METHOD).la
endif

# all_header_directory
#
# header symlinks
#
ifeq ($(MOOSE_HEADER_SYMLINKS),true)

include_files := $(shell find $(depend_dirs) -regex "[^\#~]*\.[hf]")
all_header_dir := $(APPLICATION_DIR)/build/header_symlinks

# header file links

link_names := $(foreach i, $(include_files), $(all_header_dir)/$(notdir $(i)))


$(eval $(call all_header_dir_rule, $(all_header_dir)))
$(call symlink_rules, $(all_header_dir), $(include_files))

header_symlinks:: $(all_header_dir) $(link_names)
app_INCLUDE = -I$(all_header_dir)

else # No Header Symlinks

include_dirs := $(shell find $(depend_dirs) -type d)
app_INCLUDE = $(foreach i, $(include_dirs), -I$(i))

endif

# application
app_EXEC := $(APPLICATION_DIR)/$(APPLICATION_NAME)-$(METHOD)
@@ -232,7 +239,7 @@ endif
app_LIBS := $(app_LIB) $(app_LIBS)
app_LIBS_other := $(filter-out $(app_LIB),$(app_LIBS))
app_HEADERS := $(app_HEADER) $(app_HEADERS)
app_INCLUDES += -I$(all_header_dir) $(ADDITIONAL_INCLUDES)
app_INCLUDES += $(app_INCLUDE) $(ADDITIONAL_INCLUDES)
app_DIRS += $(APPLICATION_DIR)

# WARNING: the += operator does NOT work here!
@@ -1,5 +1,6 @@
# Whether or not to do a Unity build
MOOSE_UNITY ?= true
MOOSE_HEADER_SYMLINKS ?= true

#
# MOOSE
@@ -60,6 +61,8 @@ gtest_deps := $(patsubst %.cc, %.$(obj-suffix).d, $(gtest_srcfiles))
#
# header symlinks
#
ifeq ($(MOOSE_HEADER_SYMLINKS),true)

all_header_dir := $(FRAMEWORK_DIR)/build/header_symlinks
moose_all_header_dir := $(all_header_dir)

@@ -93,8 +96,14 @@ $(eval $(call all_header_dir_rule, $(all_header_dir)))
$(call symlink_rules, $(all_header_dir), $(include_files))

header_symlinks:: $(all_header_dir) $(link_names)

moose_INC_DIRS := $(all_header_dir)

else # No Header Symlinks

moose_INC_DIRS := $(shell find $(FRAMEWORK_DIR)/include -type d)

endif

moose_INC_DIRS += $(shell find $(FRAMEWORK_DIR)/contrib/*/include -type d)
moose_INC_DIRS += "$(gtest_DIR)"
moose_INC_DIRS += "$(hit_DIR)"
@@ -40,6 +40,9 @@ some of the environment variables you can set and their effects:
find it unless you have very non-standard paths.
- `MOOSE_UNITY`: defaults to `true`, set to `false` to turn off unity builds. For more information
see the Build System Optimization section below.
- `MOOSE_HEADER_SYMLINKS`: defaults to `true`, set to `false` to turn off header symlinking. This is
an advanced option and there are very few reasons to disable this. You will likely notice a
dramatic slowdown if you set this to false.

## Build Methods (Creating "debug" Builds)

0 comments on commit 90487ec

Please sign in to comment.
You can’t perform that action at this time.