Skip to content

Commit

Permalink
fix Xcode builds (#920)
Browse files Browse the repository at this point in the history
* fix macOS build

* Revert "Revert "[build] Wrap BuildConfig.h in HAVE_CONFIG_H. (#904)" (#918)"

This reverts commit 8396966.
  • Loading branch information
Rob Walker authored May 29, 2020
1 parent 8396966 commit 3321952
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions config/efr32/efr32-app.mk
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ endif
endif

STD_DEFINES = \
HAVE_CONFIG_H \
__STARTUP_CLEAR_BSS \
$(MCU)

Expand Down
2 changes: 1 addition & 1 deletion config/nrf5/nrf5-app.mk
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ STD_LIBS = \

STD_INC_DIRS =

STD_DEFINES =
STD_DEFINES = HAVE_CONFIG_H

STD_COMPILE_PREREQUISITES = nrf5-sdk-check

Expand Down
2 changes: 2 additions & 0 deletions config/standalone/standalone-app.mk
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ STD_LIBS = \
-lm \
-lpthread

STD_DEFINES = HAVE_CONFIG_H

DEFINE_FLAGS = $(addprefix -D,$(STD_DEFINES) $(DEFINES))

INC_FLAGS = $(addprefix -I,$(INC_DIRS) $(STD_INC_DIRS))
Expand Down
2 changes: 2 additions & 0 deletions src/darwin/CHIPTool/CHIPTool.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
HAVE_CONFIG_H,
"DEBUG=1",
"$(inherited)",
);
Expand Down Expand Up @@ -379,6 +380,7 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = HAVE_CONFIG_H;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
Expand Down
6 changes: 4 additions & 2 deletions src/darwin/Framework/CHIP.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,6 @@
outputFileListPaths = (
);
outputPaths = (
"$(CHIP_PREFIX)/lib/libCHIP.a",
"$(CHIP_PREFIX)/lib/libSetupPayload.a",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -358,6 +356,7 @@
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
HAVE_CONFIG_H,
"DEBUG=1",
"$(inherited)",
);
Expand Down Expand Up @@ -415,6 +414,7 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = HAVE_CONFIG_H;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
Expand Down Expand Up @@ -565,6 +565,7 @@
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
HAVE_CONFIG_H,
"DEBUG=1",
"$(inherited)",
);
Expand Down Expand Up @@ -670,6 +671,7 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = HAVE_CONFIG_H;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
Expand Down
4 changes: 3 additions & 1 deletion src/darwin/Framework/chip_xcode_build_connector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ configure_OPTIONS+=(
configure_OPTIONS+=(--with-chip-project-includes="$CHIP_ROOT"/config/ios)
}

[[ ${PLATFORM_FAMILY_NAME} == macOS ]] && configure_OPTIONS+=(--with-chip-project-includes=no)
[[ ${PLATFORM_FAMILY_NAME} == macOS ]] && {
configure_OPTIONS+=(--with-chip-project-includes="$CHIP_ROOT"/config/standalone)
}

configure_OPTIONS+=(
--prefix="$CHIP_PREFIX"
Expand Down
2 changes: 2 additions & 0 deletions src/system/SystemConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
#define SYSTEMCONFIG_H

/* Platform include headers */
#ifdef HAVE_CONFIG_H
#include <BuildConfig.h>
#endif

/* Include a CHIP project-specific configuration file, if defined.
*
Expand Down

0 comments on commit 3321952

Please sign in to comment.