Skip to content

Commit

Permalink
kram - move to xcconfig
Browse files Browse the repository at this point in the history
Was tired of changing settings across the projects, so it's time.   Also x64 needs settings that then cause the arm64 to log warnings.

For some reason Xcode UI keeps copying the kram.config file when set on GLTF or GLTFMTL instead of referencing the common one in build2.  So I had to symlink to those.
  • Loading branch information
alecazam committed Oct 19, 2024
1 parent 8781eab commit 8eeeb1e
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 58 deletions.
26 changes: 26 additions & 0 deletions build2/kram.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// kram - Copyright 2020-2024 by Alec Miller. - MIT License
// The license and copyright notice shall be included
// in all copies or substantial portions of the Software.

// Xcode's AVX2 simd setting doesn't set -mfma or -m16c. So
// then universal builds throw hundreds of warnings. Ugh.
// Xcode doesn't set NDEBUG=1 in Release builds. Ugh.
// Also turn on -ftime-trace to review build times in kram-profile.

KRAM_FLAGS_X64 =
KRAM_FLAGS_X64[arch=x86_64] = -mf16c -mfma

KRAM_FLAGS_REL =
KRAM_FLAGS_REL[config=Release] = -NDEBUG=1

KRAM_FLAGS = -ftime-trace -DUSE_SIMDLIB=1

// This is killing build times in Xcode16
ENABLE_MODULE_VERIFIER = NO

// EASTL, etc.

// configuring all the encoders in kram
// -DCOMPILE_ASTCENC=1 -DCOMPILE_ATE=1 -DCOMPILE_ETCENC=1 -DCOMPILE_SQUISH=1 -DCOMPILE_BCENC=1 -DCOMPILE_COMP=1 -DCOMPILE_BASIS=0 -DCOMPILE_EASTL=0 $(KRAM_FLAGS)

OTHER_FLAGS = $(inherited) $(KRAM_FLAGS) $KRAM_FLAGS_REL) $(KRAM_FLAGS_X64)
36 changes: 6 additions & 30 deletions build2/kram.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@
707789D42881BA81008A51BC /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
707789EF2881BCE2008A51BC /* rdo_bc_encoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rdo_bc_encoder.cpp; sourceTree = "<group>"; };
707789F02881BCE2008A51BC /* rdo_bc_encoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rdo_bc_encoder.h; sourceTree = "<group>"; };
707D4C4B2CC41A0300729BE0 /* kram.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = kram.xcconfig; sourceTree = "<group>"; };
70871DA727DDDBCC00D0B9E1 /* astcenc_vecmathlib_common_4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = astcenc_vecmathlib_common_4.h; sourceTree = "<group>"; };
70871DA827DDDBCC00D0B9E1 /* astcenc_image.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = astcenc_image.cpp; sourceTree = "<group>"; };
70871DA927DDDBCC00D0B9E1 /* astcenc_find_best_partitioning.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = astcenc_find_best_partitioning.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1181,6 +1182,7 @@
706EEE1826D1583F001C950E /* kram */ = {
isa = PBXGroup;
children = (
707D4C4B2CC41A0300729BE0 /* kram.xcconfig */,
70CDB64E27A1382600A546C1 /* KramDDSHelper.h */,
70CDB64F27A1382600A546C1 /* KramDDSHelper.cpp */,
70B563A62C857B360089A64F /* KramZipStream.h */,
Expand Down Expand Up @@ -2282,6 +2284,7 @@
/* Begin XCBuildConfiguration section */
706ECDE726D1577A001C950E /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 707D4C4B2CC41A0300729BE0 /* kram.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
Expand Down Expand Up @@ -2371,7 +2374,7 @@
"-DCOMPILE_COMP=1",
"-DCOMPILE_BASIS=0",
"-DCOMPILE_EASTL=0",
"-ftime-trace",
"$(KRAM_FLAGS)",
);
PRESERVE_DEAD_CODE_INITS_AND_TERMS = NO;
SDKROOT = macosx;
Expand All @@ -2382,6 +2385,7 @@
};
706ECDE826D1577A001C950E /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 707D4C4B2CC41A0300729BE0 /* kram.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
Expand Down Expand Up @@ -2456,7 +2460,6 @@
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
OTHER_CFLAGS = (
"-DNDEBUG=1",
"-DCOMPILE_ASTCENC=1",
"-DCOMPILE_ATE=1",
"-DCOMPILE_ETCENC=1",
Expand All @@ -2465,7 +2468,7 @@
"-DCOMPILE_COMP=1",
"-DCOMPILE_BASIS=0",
"-DCOMPILE_EASTL=0",
"-ftime-trace",
"$(KRAM_FLAGS)",
);
PRESERVE_DEAD_CODE_INITS_AND_TERMS = NO;
SDKROOT = macosx;
Expand All @@ -2481,19 +2484,6 @@
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES;
CODE_SIGN_STYLE = Automatic;
EXECUTABLE_PREFIX = lib;
OTHER_CFLAGS = (
"-DCOMPILE_ASTCENC=1",
"-DCOMPILE_ATE=1",
"-DCOMPILE_ETCENC=1",
"-DCOMPILE_SQUISH=1",
"-DCOMPILE_BCENC=1",
"-DCOMPILE_COMP=1",
"-DCOMPILE_BASIS=0",
"-DCOMPILE_EASTL=0",
"-ftime-trace",
"-mfma",
"-mf16c",
);
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SYSTEM_HEADER_SEARCH_PATHS = "";
Expand All @@ -2507,20 +2497,6 @@
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES;
CODE_SIGN_STYLE = Automatic;
EXECUTABLE_PREFIX = lib;
OTHER_CFLAGS = (
"-DNDEBUG=1",
"-DCOMPILE_ASTCENC=1",
"-DCOMPILE_ATE=1",
"-DCOMPILE_ETCENC=1",
"-DCOMPILE_SQUISH=1",
"-DCOMPILE_BCENC=1",
"-DCOMPILE_COMP=1",
"-DCOMPILE_BASIS=0",
"-DCOMPILE_EASTL=0",
"-ftime-trace",
"-mfma",
"-mf16c",
);
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SYSTEM_HEADER_SEARCH_PATHS = "";
Expand Down
4 changes: 4 additions & 0 deletions build2/kramc.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
706EF28226D18251001C950E /* libkram.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libkram.a; sourceTree = BUILT_PRODUCTS_DIR; };
706EF28426D18257001C950E /* libate.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libate.tbd; path = usr/lib/libate.tbd; sourceTree = SDKROOT; };
706EF28A26D182CB001C950E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
707D4C542CC420FE00729BE0 /* kram.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = kram.xcconfig; sourceTree = "<group>"; };
70B687272CAD1996007ACA58 /* libvectormath.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libvectormath.a; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

Expand All @@ -59,6 +60,7 @@
706EF27E26D18223001C950E /* kramc */,
706EF27326D18082001C950E /* Products */,
706EF28126D18251001C950E /* Frameworks */,
707D4C542CC420FE00729BE0 /* kram.xcconfig */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -157,6 +159,7 @@
/* Begin XCBuildConfiguration section */
706EF27726D18082001C950E /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 707D4C542CC420FE00729BE0 /* kram.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
Expand Down Expand Up @@ -226,6 +229,7 @@
};
706EF27826D18082001C950E /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 707D4C542CC420FE00729BE0 /* kram.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
Expand Down
4 changes: 4 additions & 0 deletions build2/kramv.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
706EF25426D17C85001C950E /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; };
706EF25626D17C9D001C950E /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
706EF25926D17CAA001C950E /* libate.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libate.tbd; path = usr/lib/libate.tbd; sourceTree = SDKROOT; };
707D4C532CC420E700729BE0 /* kram.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = kram.xcconfig; sourceTree = "<group>"; };
7083365D2715642C0077BCB6 /* GLTF.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = GLTF.framework; sourceTree = BUILT_PRODUCTS_DIR; };
70833661271564320077BCB6 /* GLTFMTL.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = GLTFMTL.framework; sourceTree = BUILT_PRODUCTS_DIR; };
70833664271575E50077BCB6 /* GLTF.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = GLTF.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -223,6 +224,7 @@
70E33EE426E5478900CBA422 /* kram-preview */,
706EF21026D17A26001C950E /* Products */,
706EF24726D17BC2001C950E /* Frameworks */,
707D4C532CC420E700729BE0 /* kram.xcconfig */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -531,6 +533,7 @@
/* Begin XCBuildConfiguration section */
706EF22126D17A2E001C950E /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 707D4C532CC420E700729BE0 /* kram.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
Expand Down Expand Up @@ -610,6 +613,7 @@
};
706EF22226D17A2E001C950E /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 707D4C532CC420E700729BE0 /* kram.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
Expand Down
22 changes: 12 additions & 10 deletions build2/vectormath.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
70570FE42CB378E7005692BB /* bounds234.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bounds234.h; sourceTree = "<group>"; };
70570FE72CB37997005692BB /* bounds234.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = bounds234.cpp; sourceTree = "<group>"; };
70570FEF2CB8C5C6005692BB /* module.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = "<group>"; };
707D4C522CC41F3900729BE0 /* kram.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = kram.xcconfig; sourceTree = "<group>"; };
70B686F42CAD1026007ACA58 /* libvectormath.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libvectormath.a; sourceTree = BUILT_PRODUCTS_DIR; };
70B686FB2CAD1072007ACA58 /* double234.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = double234.h; sourceTree = "<group>"; };
70B686FC2CAD1072007ACA58 /* double234.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = double234.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -111,6 +112,7 @@
children = (
70B6870A2CAD1072007ACA58 /* vectormath */,
70B686F52CAD1026007ACA58 /* Products */,
707D4C522CC41F3900729BE0 /* kram.xcconfig */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -344,6 +346,7 @@
/* Begin XCBuildConfiguration section */
701AF18F2CAD27CB00BD0886 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 707D4C522CC41F3900729BE0 /* kram.xcconfig */;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
EXECUTABLE_PREFIX = lib;
Expand All @@ -355,6 +358,7 @@
};
701AF1902CAD27CB00BD0886 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 707D4C522CC41F3900729BE0 /* kram.xcconfig */;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
EXECUTABLE_PREFIX = lib;
Expand All @@ -366,6 +370,7 @@
};
70B686F62CAD1026007ACA58 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 707D4C522CC41F3900729BE0 /* kram.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
Expand Down Expand Up @@ -427,18 +432,15 @@
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-DUSE_SIMDLIB=1",
"-mfma",
"-mf16c",
);
OTHER_CFLAGS = "$(KRAM_FLAGS)";
SDKROOT = macosx;
XROS_DEPLOYMENT_TARGET = 2.0;
};
name = Debug;
};
70B686F72CAD1026007ACA58 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 707D4C522CC41F3900729BE0 /* kram.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
Expand Down Expand Up @@ -493,18 +495,15 @@
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c c++";
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
OTHER_CFLAGS = (
"-DUSE_SIMDLIB=1",
"-mfma",
"-mf16c",
);
OTHER_CFLAGS = "$(KRAM_FLAGS)";
SDKROOT = macosx;
XROS_DEPLOYMENT_TARGET = 2.0;
};
name = Release;
};
70B686F92CAD1026007ACA58 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 707D4C522CC41F3900729BE0 /* kram.xcconfig */;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
EXECUTABLE_PREFIX = lib;
Expand All @@ -515,6 +514,7 @@
};
70B686FA2CAD1026007ACA58 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 707D4C522CC41F3900729BE0 /* kram.xcconfig */;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
EXECUTABLE_PREFIX = lib;
Expand All @@ -525,6 +525,7 @@
};
70E3BADC2CBCE81700F11926 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 707D4C522CC41F3900729BE0 /* kram.xcconfig */;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
EXECUTABLE_PREFIX = lib;
Expand All @@ -536,6 +537,7 @@
};
70E3BADD2CBCE81700F11926 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 707D4C522CC41F3900729BE0 /* kram.xcconfig */;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
EXECUTABLE_PREFIX = lib;
Expand Down
15 changes: 6 additions & 9 deletions gtlf/GLTF/GLTF.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
707D4C5C2CC42C2700729BE0 /* kram.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = kram.xcconfig; sourceTree = "<group>"; };
83319297202589FC00B6C7E9 /* GLTFBinaryChunk.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GLTFBinaryChunk.h; sourceTree = "<group>"; };
8331929B20258A4000B6C7E9 /* GLTFBinaryChunk.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GLTFBinaryChunk.m; sourceTree = "<group>"; };
8331929E2025911D00B6C7E9 /* GLTFExtensionNames.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GLTFExtensionNames.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -144,6 +145,7 @@
83D6FF7E1F48BBFA00F71E0C /* Info.plist */,
83D6FF491F48BB3A00F71E0C /* Products */,
83D600391F48C2FF00F71E0C /* Frameworks */,
707D4C5C2CC42C2700729BE0 /* kram.xcconfig */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -353,6 +355,7 @@
/* Begin XCBuildConfiguration section */
83D6FF4E1F48BB3A00F71E0C /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 707D4C5C2CC42C2700729BE0 /* kram.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
Expand Down Expand Up @@ -408,10 +411,7 @@
MACOSX_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-ftime-trace",
"-mfma",
);
OTHER_CFLAGS = "$(KRAM_FLAGS)";
SDKROOT = macosx;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -472,11 +472,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CFLAGS = (
"-ftime-trace",
"-DNDEBUG=1",
"-mfma",
);
OTHER_CFLAGS = "$(KRAM_FLAGS)";
SDKROOT = macosx;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -515,6 +511,7 @@
};
83D6FF521F48BB3A00F71E0C /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 707D4C5C2CC42C2700729BE0 /* kram.xcconfig */;
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_IDENTITY = "";
Expand Down
1 change: 1 addition & 0 deletions gtlf/GLTF/kram.xcconfig
Loading

0 comments on commit 8eeeb1e

Please sign in to comment.