Skip to content

Commit b5e8c9c

Browse files
committed
[libllbuildSwift] Remove version protection from Swift bindings
The versioning is not really very useful as there is not really a revlock issue. The Swift bindings are built together with the C bindings and we don't have any intention of using a different version of libllbuild with libllbuildSwift. This commit hardcodes the library version in llbuild.h and removes the generation scripts and targets.
1 parent 36225da commit b5e8c9c

File tree

9 files changed

+2
-218
lines changed

9 files changed

+2
-218
lines changed

Xcode/Configs/Version.xcconfig

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,4 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
// Define the C API version
14-
//
15-
// See products/libllbuild/include/llbuild/llbuild.h for version history
16-
LLBUILD_C_API_VERSION = 6
17-
18-
// We define both the version value and a named version. The latter is useful
19-
// in Swift conditional compilation, where we don't currently have the ability
20-
// to do more complex numeric comparisons.
21-
LLBUILD_VERSION_DEFINITIONS = LLBUILD_C_API_VERSION=$(LLBUILD_C_API_VERSION) LLBUILD_C_API_VERSION_$(LLBUILD_C_API_VERSION)
22-
23-
LLBUILD_SWIFT_VERSION_DEFINITIONS = LLBUILD_C_API_VERSION_$(LLBUILD_C_API_VERSION)
24-
2513
SWIFT_VERSION = 4.2

llbuild.xcodeproj/project.pbxproj

Lines changed: 0 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,12 @@
77
objects = {
88

99
/* Begin PBXAggregateTarget section */
10-
40513F172057621500DCA088 /* Generate-version.h */ = {
11-
isa = PBXAggregateTarget;
12-
buildConfigurationList = 40513F1A2057621500DCA088 /* Build configuration list for PBXAggregateTarget "Generate-version.h" */;
13-
buildPhases = (
14-
40513F1B2057626A00DCA088 /* Generate version.h */,
15-
);
16-
dependencies = (
17-
);
18-
name = "Generate-version.h";
19-
productName = "Generate version.h";
20-
};
2110
E178FCC11A1BF3270039F8B5 /* B&I */ = {
2211
isa = PBXAggregateTarget;
2312
buildConfigurationList = E178FCC41A1BF3270039F8B5 /* Build configuration list for PBXAggregateTarget "B&I" */;
2413
buildPhases = (
2514
);
2615
dependencies = (
27-
4020AD1E20584D4600884842 /* PBXTargetDependency */,
2816
E178FCC61A1BF32F0039F8B5 /* PBXTargetDependency */,
2917
E1604CB71BB9E07B001153A1 /* PBXTargetDependency */,
3018
E1B839631B541CDE00DB876B /* PBXTargetDependency */,
@@ -77,7 +65,6 @@
7765

7866
/* Begin PBXBuildFile section */
7967
402614272087B10B005BD956 /* Tracing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 402614262087B10B005BD956 /* Tracing.cpp */; };
80-
403B1A492053123B0018A322 /* version.h in Headers */ = {isa = PBXBuildFile; fileRef = 403B1A48205312000018A322 /* version.h */; settings = {ATTRIBUTES = (Public, ); }; };
8168
40B3C91020D3AEC9007C5847 /* libcurses.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = E15B6EC61B546A2C00643066 /* libcurses.tbd */; };
8269
40B3C91120D3AEC9007C5847 /* libgtest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E1A224DD19F99B0E0059043E /* libgtest.a */; };
8370
40B3C91220D3AEC9007C5847 /* libgtest_main.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E1A224E619F99C580059043E /* libgtest_main.a */; };
@@ -255,34 +242,6 @@
255242
/* End PBXBuildFile section */
256243

257244
/* Begin PBXContainerItemProxy section */
258-
4020AD1D20584D4600884842 /* PBXContainerItemProxy */ = {
259-
isa = PBXContainerItemProxy;
260-
containerPortal = E1A223E919F98F1C0059043E /* Project object */;
261-
proxyType = 1;
262-
remoteGlobalIDString = 40513F172057621500DCA088;
263-
remoteInfo = "Generate-version.h";
264-
};
265-
40513F1C2057629D00DCA088 /* PBXContainerItemProxy */ = {
266-
isa = PBXContainerItemProxy;
267-
containerPortal = E1A223E919F98F1C0059043E /* Project object */;
268-
proxyType = 1;
269-
remoteGlobalIDString = 40513F172057621500DCA088;
270-
remoteInfo = "Generate version.h";
271-
};
272-
40513F1E205762CD00DCA088 /* PBXContainerItemProxy */ = {
273-
isa = PBXContainerItemProxy;
274-
containerPortal = E1A223E919F98F1C0059043E /* Project object */;
275-
proxyType = 1;
276-
remoteGlobalIDString = 40513F172057621500DCA088;
277-
remoteInfo = "Generate-version.h";
278-
};
279-
40513F20205762DF00DCA088 /* PBXContainerItemProxy */ = {
280-
isa = PBXContainerItemProxy;
281-
containerPortal = E1A223E919F98F1C0059043E /* Project object */;
282-
proxyType = 1;
283-
remoteGlobalIDString = 40513F172057621500DCA088;
284-
remoteInfo = "Generate-version.h";
285-
};
286245
40B3C90220D3AEC9007C5847 /* PBXContainerItemProxy */ = {
287246
isa = PBXContainerItemProxy;
288247
containerPortal = E1A223E919F98F1C0059043E /* Project object */;
@@ -2420,7 +2379,6 @@
24202379
isa = PBXHeadersBuildPhase;
24212380
buildActionMask = 2147483647;
24222381
files = (
2423-
403B1A492053123B0018A322 /* version.h in Headers */,
24242382
E1D191CA1B472440000C4E95 /* llbuild.h in Headers */,
24252383
E1BE0AAE1C46F94000AD0883 /* core.h in Headers */,
24262384
E1192CED1C49D84500F85890 /* buildsystem.h in Headers */,
@@ -2463,7 +2421,6 @@
24632421
buildRules = (
24642422
);
24652423
dependencies = (
2466-
40513F1F205762CD00DCA088 /* PBXTargetDependency */,
24672424
9DB047B81DF9D483006CDF52 /* PBXTargetDependency */,
24682425
9DB047B41DF9D471006CDF52 /* PBXTargetDependency */,
24692426
9DB047B21DF9D469006CDF52 /* PBXTargetDependency */,
@@ -2778,7 +2735,6 @@
27782735
buildRules = (
27792736
);
27802737
dependencies = (
2781-
40513F21205762DF00DCA088 /* PBXTargetDependency */,
27822738
E104FAFD1B655C3C005C68A0 /* PBXTargetDependency */,
27832739
E17C29E61B5AAF6100C12DA9 /* PBXTargetDependency */,
27842740
E17C29EA1B5AAF6100C12DA9 /* PBXTargetDependency */,
@@ -2802,7 +2758,6 @@
28022758
buildRules = (
28032759
);
28042760
dependencies = (
2805-
40513F1D2057629D00DCA088 /* PBXTargetDependency */,
28062761
E1B839461B52EAA900DB876B /* PBXTargetDependency */,
28072762
E1B839421B52EA9E00DB876B /* PBXTargetDependency */,
28082763
E1B839441B52EAA500DB876B /* PBXTargetDependency */,
@@ -2823,10 +2778,6 @@
28232778
LastUpgradeCheck = 9900;
28242779
ORGANIZATIONNAME = "Apple Inc.";
28252780
TargetAttributes = {
2826-
40513F172057621500DCA088 = {
2827-
CreatedOnToolsVersion = 10.0;
2828-
ProvisioningStyle = Automatic;
2829-
};
28302781
9DB047A71DF9D43D006CDF52 = {
28312782
CreatedOnToolsVersion = 8.3;
28322783
ProvisioningStyle = Automatic;
@@ -2926,7 +2877,6 @@
29262877
projectRoot = "";
29272878
targets = (
29282879
E178FCC11A1BF3270039F8B5 /* B&I */,
2929-
40513F172057621500DCA088 /* Generate-version.h */,
29302880
E1A224C219F999B80059043E /* llbuild Tool */,
29312881
E1604C951BB9E01D001153A1 /* swift-build-tool */,
29322882
E1D191BD1B47232B000C4E95 /* llbuild-framework */,
@@ -2972,23 +2922,6 @@
29722922
/* End PBXResourcesBuildPhase section */
29732923

29742924
/* Begin PBXShellScriptBuildPhase section */
2975-
40513F1B2057626A00DCA088 /* Generate version.h */ = {
2976-
isa = PBXShellScriptBuildPhase;
2977-
buildActionMask = 12;
2978-
files = (
2979-
);
2980-
inputPaths = (
2981-
"$(SRCROOT)/products/libllbuild/include/llbuild/version.h.in",
2982-
);
2983-
name = "Generate version.h";
2984-
outputPaths = (
2985-
"$(SRCROOT)/products/libllbuild/include/llbuild/version.h",
2986-
);
2987-
runOnlyForDeploymentPostprocessing = 0;
2988-
shellPath = /bin/sh;
2989-
shellScript = "\"${SRCROOT}/utils/generate-version-h.sh\"";
2990-
showEnvVarsInLog = 0;
2991-
};
29922925
40B3C91620D3AEC9007C5847 /* Create Target Link */ = {
29932926
isa = PBXShellScriptBuildPhase;
29942927
buildActionMask = 2147483647;
@@ -3391,26 +3324,6 @@
33913324
/* End PBXSourcesBuildPhase section */
33923325

33933326
/* Begin PBXTargetDependency section */
3394-
4020AD1E20584D4600884842 /* PBXTargetDependency */ = {
3395-
isa = PBXTargetDependency;
3396-
target = 40513F172057621500DCA088 /* Generate-version.h */;
3397-
targetProxy = 4020AD1D20584D4600884842 /* PBXContainerItemProxy */;
3398-
};
3399-
40513F1D2057629D00DCA088 /* PBXTargetDependency */ = {
3400-
isa = PBXTargetDependency;
3401-
target = 40513F172057621500DCA088 /* Generate-version.h */;
3402-
targetProxy = 40513F1C2057629D00DCA088 /* PBXContainerItemProxy */;
3403-
};
3404-
40513F1F205762CD00DCA088 /* PBXTargetDependency */ = {
3405-
isa = PBXTargetDependency;
3406-
target = 40513F172057621500DCA088 /* Generate-version.h */;
3407-
targetProxy = 40513F1E205762CD00DCA088 /* PBXContainerItemProxy */;
3408-
};
3409-
40513F21205762DF00DCA088 /* PBXTargetDependency */ = {
3410-
isa = PBXTargetDependency;
3411-
target = 40513F172057621500DCA088 /* Generate-version.h */;
3412-
targetProxy = 40513F20205762DF00DCA088 /* PBXContainerItemProxy */;
3413-
};
34143327
40B3C90120D3AEC9007C5847 /* PBXTargetDependency */ = {
34153328
isa = PBXTargetDependency;
34163329
target = E1A224DC19F99B0E0059043E /* gtest */;
@@ -3719,20 +3632,6 @@
37193632
/* End PBXTargetDependency section */
37203633

37213634
/* Begin XCBuildConfiguration section */
3722-
40513F182057621500DCA088 /* Debug */ = {
3723-
isa = XCBuildConfiguration;
3724-
buildSettings = {
3725-
INSTALLHDRS_SCRIPT_PHASE = YES;
3726-
};
3727-
name = Debug;
3728-
};
3729-
40513F192057621500DCA088 /* Release */ = {
3730-
isa = XCBuildConfiguration;
3731-
buildSettings = {
3732-
INSTALLHDRS_SCRIPT_PHASE = YES;
3733-
};
3734-
name = Release;
3735-
};
37363635
40B3C91820D3AEC9007C5847 /* Debug */ = {
37373636
isa = XCBuildConfiguration;
37383637
buildSettings = {
@@ -4244,15 +4143,6 @@
42444143
/* End XCBuildConfiguration section */
42454144

42464145
/* Begin XCConfigurationList section */
4247-
40513F1A2057621500DCA088 /* Build configuration list for PBXAggregateTarget "Generate-version.h" */ = {
4248-
isa = XCConfigurationList;
4249-
buildConfigurations = (
4250-
40513F182057621500DCA088 /* Debug */,
4251-
40513F192057621500DCA088 /* Release */,
4252-
);
4253-
defaultConfigurationIsVisible = 0;
4254-
defaultConfigurationName = Release;
4255-
};
42564146
40B3C91720D3AEC9007C5847 /* Build configuration list for PBXNativeTarget "CAPITests" */ = {
42574147
isa = XCConfigurationList;
42584148
buildConfigurations = (

products/libllbuild/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@ set_property(TARGET libllbuild PROPERTY MACOSX_RPATH ON)
2222

2323
target_link_libraries(libllbuild ${DEPENDENCIES})
2424

25-
# Load version number from the XCConfig
26-
file(STRINGS "${CMAKE_SOURCE_DIR}/Xcode/Configs/Version.xcconfig" VERSION_XCCONFIG)
27-
if(VERSION_XCCONFIG MATCHES ".*LLBUILD_C_API_VERSION = ([0-9]+).*")
28-
string(REGEX REPLACE ".*LLBUILD_C_API_VERSION = ([0-9]+).*" "\\1" LLBUILD_C_API_VERSION "${VERSION_XCCONFIG}")
29-
else(VERSION_XCCONFIG MATCHES ".*LLBUILD_C_API_VERSION = ([0-9]+).*")
30-
message(FATAL_ERROR "Unable to find LLBUILD_C_API_VERSION in Version.xcconfig")
31-
endif(VERSION_XCCONFIG MATCHES ".*LLBUILD_C_API_VERSION = ([0-9]+).*")
32-
33-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/llbuild/version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/include/llbuild/version.h)
34-
3525
include_directories(BEFORE
3626
${CMAKE_CURRENT_SOURCE_DIR}/include)
3727

products/libllbuild/include/llbuild/llbuild.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
/// 1: Added `environment` parameter to llb_buildsystem_invocation_t.
5252
///
5353
/// 0: Pre-history
54-
#include "version.h"
54+
#define LLBUILD_C_API_VERSION 6
5555

5656
/// Get the full version of the llbuild library.
5757
LLBUILD_EXPORT const char* llb_get_full_version_string(void);

products/libllbuild/include/llbuild/version.h

Lines changed: 0 additions & 19 deletions
This file was deleted.

products/libllbuild/include/llbuild/version.h.in

Lines changed: 0 additions & 19 deletions
This file was deleted.

products/llbuildSwift/BuildSystemBindings.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ import Foundation
2222
import llbuild
2323
#endif
2424

25-
#if !LLBUILD_C_API_VERSION_6
26-
#if swift(>=4.2)
27-
#error("Unsupported llbuild C API version")
28-
#else
29-
import llbuild_c_api_version_unsupported
30-
#endif
31-
#endif
32-
3325
private func bytesFromData(_ data: llb_data_t) -> [UInt8] {
3426
return Array(UnsafeBufferPointer(start: data.data, count: Int(data.length)))
3527
}

products/llbuildSwift/CMakeLists.txt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,8 @@ set(SOURCES
33
BuildSystemBindings.swift
44
CoreBindings.swift)
55

6-
# Load version number from the XCConfig
7-
file(STRINGS "${CMAKE_SOURCE_DIR}/Xcode/Configs/Version.xcconfig" VERSION_XCCONFIG)
8-
if(VERSION_XCCONFIG MATCHES ".*LLBUILD_C_API_VERSION = ([0-9]+).*")
9-
string(REGEX REPLACE ".*LLBUILD_C_API_VERSION = ([0-9]+).*" "\\1" LLBUILD_C_API_VERSION "${VERSION_XCCONFIG}")
10-
else(VERSION_XCCONFIG MATCHES ".*LLBUILD_C_API_VERSION = ([0-9]+).*")
11-
message(FATAL_ERROR "Unable to find LLBUILD_C_API_VERSION in Version.xcconfig")
12-
endif(VERSION_XCCONFIG MATCHES ".*LLBUILD_C_API_VERSION = ([0-9]+).*")
13-
14-
156
# Link C API.
16-
list(APPEND additional_args -DLLBUILD_C_API_VERSION_${LLBUILD_C_API_VERSION} -I ${CMAKE_CURRENT_SOURCE_DIR}/../libllbuild/include -lllbuild)
7+
list(APPEND additional_args -I ${CMAKE_CURRENT_SOURCE_DIR}/../libllbuild/include -lllbuild)
178

189
if(APPLE)
1910
list(APPEND additional_args -target x86_64-apple-macosx10.10)

utils/generate-version-h.sh

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)