Skip to content

Commit 3321952

Browse files
author
Rob Walker
authored
fix Xcode builds (project-chip#920)
* fix macOS build * Revert "Revert "[build] Wrap BuildConfig.h in HAVE_CONFIG_H. (project-chip#904)" (project-chip#918)" This reverts commit 8396966.
1 parent 8396966 commit 3321952

File tree

7 files changed

+15
-4
lines changed

7 files changed

+15
-4
lines changed

config/efr32/efr32-app.mk

+1
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ endif
263263
endif
264264

265265
STD_DEFINES = \
266+
HAVE_CONFIG_H \
266267
__STARTUP_CLEAR_BSS \
267268
$(MCU)
268269

config/nrf5/nrf5-app.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ STD_LIBS = \
144144

145145
STD_INC_DIRS =
146146

147-
STD_DEFINES =
147+
STD_DEFINES = HAVE_CONFIG_H
148148

149149
STD_COMPILE_PREREQUISITES = nrf5-sdk-check
150150

config/standalone/standalone-app.mk

+2
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ STD_LIBS = \
9191
-lm \
9292
-lpthread
9393

94+
STD_DEFINES = HAVE_CONFIG_H
95+
9496
DEFINE_FLAGS = $(addprefix -D,$(STD_DEFINES) $(DEFINES))
9597

9698
INC_FLAGS = $(addprefix -I,$(INC_DIRS) $(STD_INC_DIRS))

src/darwin/CHIPTool/CHIPTool.xcodeproj/project.pbxproj

+2
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@
324324
GCC_NO_COMMON_BLOCKS = YES;
325325
GCC_OPTIMIZATION_LEVEL = 0;
326326
GCC_PREPROCESSOR_DEFINITIONS = (
327+
HAVE_CONFIG_H,
327328
"DEBUG=1",
328329
"$(inherited)",
329330
);
@@ -379,6 +380,7 @@
379380
ENABLE_STRICT_OBJC_MSGSEND = YES;
380381
GCC_C_LANGUAGE_STANDARD = gnu11;
381382
GCC_NO_COMMON_BLOCKS = YES;
383+
GCC_PREPROCESSOR_DEFINITIONS = HAVE_CONFIG_H;
382384
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
383385
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
384386
GCC_WARN_UNDECLARED_SELECTOR = YES;

src/darwin/Framework/CHIP.xcodeproj/project.pbxproj

+4-2
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,6 @@
273273
outputFileListPaths = (
274274
);
275275
outputPaths = (
276-
"$(CHIP_PREFIX)/lib/libCHIP.a",
277-
"$(CHIP_PREFIX)/lib/libSetupPayload.a",
278276
);
279277
runOnlyForDeploymentPostprocessing = 0;
280278
shellPath = /bin/sh;
@@ -358,6 +356,7 @@
358356
GCC_NO_COMMON_BLOCKS = YES;
359357
GCC_OPTIMIZATION_LEVEL = 0;
360358
GCC_PREPROCESSOR_DEFINITIONS = (
359+
HAVE_CONFIG_H,
361360
"DEBUG=1",
362361
"$(inherited)",
363362
);
@@ -415,6 +414,7 @@
415414
ENABLE_STRICT_OBJC_MSGSEND = YES;
416415
GCC_C_LANGUAGE_STANDARD = gnu11;
417416
GCC_NO_COMMON_BLOCKS = YES;
417+
GCC_PREPROCESSOR_DEFINITIONS = HAVE_CONFIG_H;
418418
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
419419
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
420420
GCC_WARN_UNDECLARED_SELECTOR = YES;
@@ -565,6 +565,7 @@
565565
GCC_NO_COMMON_BLOCKS = YES;
566566
GCC_OPTIMIZATION_LEVEL = 0;
567567
GCC_PREPROCESSOR_DEFINITIONS = (
568+
HAVE_CONFIG_H,
568569
"DEBUG=1",
569570
"$(inherited)",
570571
);
@@ -670,6 +671,7 @@
670671
ENABLE_STRICT_OBJC_MSGSEND = YES;
671672
GCC_C_LANGUAGE_STANDARD = gnu11;
672673
GCC_NO_COMMON_BLOCKS = YES;
674+
GCC_PREPROCESSOR_DEFINITIONS = HAVE_CONFIG_H;
673675
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
674676
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
675677
GCC_WARN_UNDECLARED_SELECTOR = YES;

src/darwin/Framework/chip_xcode_build_connector.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ configure_OPTIONS+=(
5858
configure_OPTIONS+=(--with-chip-project-includes="$CHIP_ROOT"/config/ios)
5959
}
6060

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

6365
configure_OPTIONS+=(
6466
--prefix="$CHIP_PREFIX"

src/system/SystemConfig.h

+2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
#define SYSTEMCONFIG_H
3939

4040
/* Platform include headers */
41+
#ifdef HAVE_CONFIG_H
4142
#include <BuildConfig.h>
43+
#endif
4244

4345
/* Include a CHIP project-specific configuration file, if defined.
4446
*

0 commit comments

Comments
 (0)