Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

View File

@ -0,0 +1,31 @@
cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
cmake_policy(VERSION 2.8.8)
project(test)
set(configuration "Default")
enable_language(ASM)
set(builddir "${CMAKE_CURRENT_BINARY_DIR}")
set(obj "${builddir}/obj")
set(CMAKE_C_OUTPUT_EXTENSION_REPLACE 1)
set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)
#*/gyp-next/test/fixtures/integration.gyp:test#target
set(TARGET "test")
set(TOOLSET "target")
set(test__cxx_srcs "../../test.cc")
link_directories( ../../mylib
)
add_executable(test ${test__cxx_srcs})
set_target_properties(test PROPERTIES EXCLUDE_FROM_ALL "FALSE")
set_target_properties(test PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${builddir}")
set_target_properties(test PROPERTIES PREFIX "")
set_target_properties(test PROPERTIES RUNTIME_OUTPUT_NAME "test")
set_target_properties(test PROPERTIES SUFFIX "")
set_source_files_properties(${builddir}/test PROPERTIES GENERATED "TRUE")
set(test__include_dirs "${CMAKE_CURRENT_LIST_DIR}/../../include")
set_property(TARGET test APPEND PROPERTY INCLUDE_DIRECTORIES ${test__include_dirs})
set_target_properties(test PROPERTIES COMPILE_FLAGS "-fasm-blocks -mpascal-strings -Os -gdwarf-2 -arch x86_64 ")
unset(TOOLSET)
unset(TARGET)

View File

@ -0,0 +1,86 @@
# This file is generated by gyp; do not edit.
TOOLSET := target
TARGET := test
DEFS_Default :=
# Flags passed to all source files.
CFLAGS_Default := \
-fasm-blocks \
-mpascal-strings \
-Os \
-gdwarf-2 \
-arch \
x86_64
# Flags passed to only C files.
CFLAGS_C_Default :=
# Flags passed to only C++ files.
CFLAGS_CC_Default :=
# Flags passed to only ObjC files.
CFLAGS_OBJC_Default :=
# Flags passed to only ObjC++ files.
CFLAGS_OBJCC_Default :=
INCS_Default := \
-I$(srcdir)/include
OBJS := \
$(obj).target/$(TARGET)/test.o
# Add to the list of files we specially track dependencies for.
all_deps += $(OBJS)
# CFLAGS et al overrides must be target-local.
# See "Target-specific Variable Values" in the GNU Make manual.
$(OBJS): TOOLSET := $(TOOLSET)
$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))
$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))
$(OBJS): GYP_OBJCFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))
$(OBJS): GYP_OBJCXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))
# Suffix rules, putting all outputs into $(obj).
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
# Try building from generated source, too.
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
# End of this set of suffix rules
### Rules for final target.
LDFLAGS_Default := \
-arch \
x86_64 \
-L$(builddir) \
-L$(srcdir)/mylib
LIBTOOLFLAGS_Default :=
LIBS :=
$(builddir)/test: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))
$(builddir)/test: LIBS := $(LIBS)
$(builddir)/test: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))
$(builddir)/test: LD_INPUTS := $(OBJS)
$(builddir)/test: TOOLSET := $(TOOLSET)
$(builddir)/test: $(OBJS) FORCE_DO_CMD
$(call do_cmd,link)
all_deps += $(builddir)/test
# Add target alias
.PHONY: test
test: $(builddir)/test
# Add executable to "all" target.
.PHONY: all
all: $(builddir)/test

View File

@ -0,0 +1,15 @@
defines =
includes = -I../../include
cflags = -fasm-blocks -mpascal-strings -Os -gdwarf-2 -arch x86_64
cflags_c =
cflags_cc =
cflags_objc = $cflags_c
cflags_objcc = $cflags_cc
arflags =
build obj/test.test.o: cxx ../../test.cc
ldflags = -arch x86_64 -L./
libs = -L../../mylib
build test: link obj/test.test.o
ld = $ldxx

View File

@ -0,0 +1,32 @@
cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
cmake_policy(VERSION 2.8.8)
project(test)
set(configuration "Default")
enable_language(ASM)
set(builddir "${CMAKE_CURRENT_BINARY_DIR}")
set(obj "${builddir}/obj")
set(CMAKE_C_OUTPUT_EXTENSION_REPLACE 1)
set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)
set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1)
#*/test/fixtures/integration.gyp:test#target
set(TARGET "test")
set(TOOLSET "target")
set(test__cxx_srcs "../../test.cc")
link_directories( ../../mylib
)
add_executable(test ${test__cxx_srcs})
set_target_properties(test PROPERTIES EXCLUDE_FROM_ALL "FALSE")
set_target_properties(test PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${builddir}")
set_target_properties(test PROPERTIES PREFIX "")
set_target_properties(test PROPERTIES RUNTIME_OUTPUT_NAME "test")
set_target_properties(test PROPERTIES SUFFIX "")
set_source_files_properties(${builddir}/test PROPERTIES GENERATED "TRUE")
set(test__include_dirs "${CMAKE_CURRENT_LIST_DIR}/../../include")
set_property(TARGET test APPEND PROPERTY INCLUDE_DIRECTORIES ${test__include_dirs})
set_target_properties(test PROPERTIES COMPILE_FLAGS "")
unset(TOOLSET)
unset(TARGET)

View File

@ -0,0 +1,66 @@
# This file is generated by gyp; do not edit.
TOOLSET := target
TARGET := test
DEFS_Default :=
# Flags passed to all source files.
CFLAGS_Default :=
# Flags passed to only C files.
CFLAGS_C_Default :=
# Flags passed to only C++ files.
CFLAGS_CC_Default :=
INCS_Default := \
-I$(srcdir)/include
OBJS := \
$(obj).target/$(TARGET)/test.o
# Add to the list of files we specially track dependencies for.
all_deps += $(OBJS)
# CFLAGS et al overrides must be target-local.
# See "Target-specific Variable Values" in the GNU Make manual.
$(OBJS): TOOLSET := $(TOOLSET)
$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))
$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))
# Suffix rules, putting all outputs into $(obj).
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
# Try building from generated source, too.
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
# End of this set of suffix rules
### Rules for final target.
LDFLAGS_Default := \
-L$(srcdir)/mylib
LIBS :=
$(builddir)/test: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))
$(builddir)/test: LIBS := $(LIBS)
$(builddir)/test: LD_INPUTS := $(OBJS)
$(builddir)/test: TOOLSET := $(TOOLSET)
$(builddir)/test: $(OBJS) FORCE_DO_CMD
$(call do_cmd,link)
all_deps += $(builddir)/test
# Add target alias
.PHONY: test
test: $(builddir)/test
# Add executable to "all" target.
.PHONY: all
all: $(builddir)/test

View File

@ -0,0 +1,13 @@
defines =
includes = -I../../include
cflags =
cflags_c =
cflags_cc =
arflags =
build obj/test.test.o: cxx ../../test.cc
ldflags =
libs = -L../../mylib
build test: link obj/test.test.o
ld = $ldxx

View File

@ -0,0 +1,3 @@
#pragma once
int foo();

17
tools/gyp/test/fixtures/integration.gyp vendored Normal file
View File

@ -0,0 +1,17 @@
{
'targets': [
{
'target_name': 'test',
'type': 'executable',
'sources': [
'test.cc',
],
'include_dirs': [
'include',
],
'library_dirs': [
'mylib'
],
},
]
}

9
tools/gyp/test/fixtures/test.cc vendored Normal file
View File

@ -0,0 +1,9 @@
#include "test.h"
int main() {
return foo();
}
int foo() {
return 0;
}

View File

@ -0,0 +1,70 @@
#!/usr/bin/env python3
"""Integration test"""
import os
import re
import shutil
import unittest
import gyp
fixture_dir = os.path.join(os.path.dirname(__file__), "fixtures")
gyp_file = os.path.join(os.path.dirname(__file__), "fixtures/integration.gyp")
supported_sysnames = {"darwin", "linux"}
sysname = os.uname().sysname.lower()
expected_dir = os.path.join(fixture_dir, f"expected-{sysname}")
class TestGyp(unittest.TestCase):
def setUp(self) -> None:
if sysname not in supported_sysnames:
self.skipTest(f"Unsupported system: {sysname}")
shutil.rmtree(os.path.join(fixture_dir, "out"), ignore_errors=True)
def assert_file(self, actual, expected) -> None:
actual_filepath = os.path.join(fixture_dir, actual)
expected_filepath = os.path.join(expected_dir, expected)
with open(expected_filepath) as in_file:
expected_bytes = re.escape(in_file.read())
expected_bytes = expected_bytes.replace("\\*", ".*")
expected_re = re.compile(expected_bytes)
with open(actual_filepath) as in_file:
actual_bytes = in_file.read()
try:
self.assertRegex(actual_bytes, expected_re)
except Exception:
shutil.copyfile(actual_filepath, f"{expected_filepath}.actual")
raise
def test_ninja(self) -> None:
rc = gyp.main(["-f", "ninja", "--depth", fixture_dir, gyp_file])
assert rc == 0
self.assert_file("out/Default/obj/test.ninja", "ninja/test.ninja")
def test_make(self) -> None:
rc = gyp.main(
[
"-f",
"make",
"--depth",
fixture_dir,
"--generator-output",
"out",
gyp_file,
]
)
assert rc == 0
self.assert_file("out/test.target.mk", "make/test.target.mk")
def test_cmake(self) -> None:
rc = gyp.main(["-f", "cmake", "--depth", fixture_dir, gyp_file])
assert rc == 0
self.assert_file("out/Default/CMakeLists.txt", "cmake/CMakeLists.txt")