Initial commit
This commit is contained in:
21
eabase/all/conandata.yml
Normal file
21
eabase/all/conandata.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
sources:
|
||||
"01082025":
|
||||
url: "https://github.com/electronicarts/EABase/archive/0699a15efdfd20b6cecf02153bfa5663decb653c.zip"
|
||||
sha256: "bf3bcf296cd1960d95b145f404d2b325e65b47b750e654ca19d05f1e4fc763a5"
|
||||
"18082024":
|
||||
url: "https://github.com/electronicarts/EABase/archive/123363eb82e132c0181ac53e43226d8ee76dea12.zip"
|
||||
sha256: "74ee83236e40122cafff06a9456f1a28b24b6fd94cf72cc8615b7a9470895adc"
|
||||
"2.09.12":
|
||||
url: "https://github.com/electronicarts/EABase/archive/d1be0a1d0fc01a9bf8f3f2cea75018df0d2410ee.zip"
|
||||
sha256: "53b72d188aa17c7b23aa6bef9a4767854e82eac46a027dec233d12fd3dfbc677"
|
||||
"2.09.06":
|
||||
url: "https://github.com/electronicarts/EABase/archive/refs/heads/2.09.06.zip"
|
||||
sha256: "3223c2b81dcdccaeb9fca7a83695f9edb402b817c89c073c0eb3ee64646699ea"
|
||||
"2.09.05":
|
||||
url: "https://github.com/electronicarts/EABase/archive/2.09.05.tar.gz"
|
||||
sha256: "f85b98c96f1976aa013c8d6016c5e37a409633ac3fce843cd4ec0b89c67e6b7a"
|
||||
patches:
|
||||
"01082025":
|
||||
- patch_file: "patches/bump_cmake.patch"
|
||||
patch_description: "Bump cmake version"
|
||||
patch_type: "conan"
|
||||
68
eabase/all/conanfile.py
Normal file
68
eabase/all/conanfile.py
Normal file
@@ -0,0 +1,68 @@
|
||||
import os
|
||||
|
||||
from conan import ConanFile
|
||||
from conan.tools.files import (
|
||||
apply_conandata_patches,
|
||||
export_conandata_patches,
|
||||
copy,
|
||||
get,
|
||||
)
|
||||
from conan.tools.layout import basic_layout
|
||||
|
||||
required_conan_version = ">=1.52.0"
|
||||
|
||||
|
||||
class EABaseConan(ConanFile):
|
||||
name = "eabase"
|
||||
description = "EABase is a small set of header files that define platform-independent data types and platform feature macros. "
|
||||
topics = ("eastl", "config")
|
||||
license = "BSD-3-Clause"
|
||||
url = "https://github.com/conan-io/conan-center-index"
|
||||
homepage = "https://github.com/electronicarts/EABase"
|
||||
package_type = "header-library"
|
||||
settings = "os", "arch", "compiler", "build_type"
|
||||
no_copy_source = True
|
||||
|
||||
def layout(self):
|
||||
basic_layout(self, src_folder="src")
|
||||
|
||||
def package_id(self):
|
||||
self.info.clear()
|
||||
|
||||
def export_sources(self):
|
||||
export_conandata_patches(self)
|
||||
|
||||
def source(self):
|
||||
get(self, **self.conan_data["sources"][self.version], strip_root=True)
|
||||
apply_conandata_patches(self)
|
||||
|
||||
def package(self):
|
||||
copy(
|
||||
self,
|
||||
pattern="LICENSE",
|
||||
dst=os.path.join(self.package_folder, "licenses"),
|
||||
src=self.source_folder,
|
||||
)
|
||||
copy(
|
||||
self,
|
||||
pattern="*.h",
|
||||
dst=os.path.join(self.package_folder, "include"),
|
||||
src=os.path.join(self.source_folder, "include"),
|
||||
)
|
||||
|
||||
def package_info(self):
|
||||
self.cpp_info.bindirs = []
|
||||
self.cpp_info.libdirs = []
|
||||
self.cpp_info.includedirs += [
|
||||
os.path.join("include", "Common"),
|
||||
os.path.join("include", "Common", "EABase"),
|
||||
]
|
||||
|
||||
self.cpp_info.set_property("cmake_file_name", "EABase")
|
||||
self.cpp_info.set_property("cmake_target_name", "EABase::EABase")
|
||||
|
||||
# TODO: to remove in conan v2 once cmake_find_package_* generators removed
|
||||
self.cpp_info.filenames["cmake_find_package"] = "EABase"
|
||||
self.cpp_info.filenames["cmake_find_package_multi"] = "EABase"
|
||||
self.cpp_info.names["cmake_find_package"] = "EABase"
|
||||
self.cpp_info.names["cmake_find_package_multi"] = "EABase"
|
||||
13
eabase/all/patches/bump_cmake.patch
Normal file
13
eabase/all/patches/bump_cmake.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 652f07f..11e4430 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1,7 +1,7 @@
|
||||
#-------------------------------------------------------------------------------------------
|
||||
# Copyright (C) Electronic Arts Inc. All rights reserved.
|
||||
#-------------------------------------------------------------------------------------------
|
||||
-cmake_minimum_required(VERSION 3.1)
|
||||
+cmake_minimum_required(VERSION 3.5)
|
||||
project(EABase CXX)
|
||||
|
||||
#-------------------------------------------------------------------------------------------
|
||||
8
eabase/all/test_package/CMakeLists.txt
Normal file
8
eabase/all/test_package/CMakeLists.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
project(test_package LANGUAGES CXX)
|
||||
|
||||
find_package(EABase REQUIRED CONFIG)
|
||||
|
||||
add_executable(${PROJECT_NAME} test_package.cpp)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE EABase::EABase)
|
||||
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
|
||||
27
eabase/all/test_package/conanfile.py
Normal file
27
eabase/all/test_package/conanfile.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from conan import ConanFile
|
||||
from conan.tools.build import can_run
|
||||
from conan.tools.cmake import cmake_layout, CMake
|
||||
import os
|
||||
|
||||
|
||||
# It will become the standard on Conan 2.x
|
||||
class TestPackageConan(ConanFile):
|
||||
settings = "os", "arch", "compiler", "build_type"
|
||||
generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv"
|
||||
test_type = "explicit"
|
||||
|
||||
def layout(self):
|
||||
cmake_layout(self)
|
||||
|
||||
def requirements(self):
|
||||
self.requires(self.tested_reference_str)
|
||||
|
||||
def build(self):
|
||||
cmake = CMake(self)
|
||||
cmake.configure()
|
||||
cmake.build()
|
||||
|
||||
def test(self):
|
||||
if can_run(self):
|
||||
bin_path = os.path.join(self.cpp.build.bindir, "test_package")
|
||||
self.run(bin_path, env="conanrun")
|
||||
47
eabase/all/test_package/test_package.cpp
Normal file
47
eabase/all/test_package/test_package.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
#include <eabase.h>
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
#ifndef EA_COMPILER_IS_ANSIC
|
||||
#define EA_COMPILER_IS_ANSIC 0
|
||||
#endif
|
||||
#ifndef EA_COMPILER_IS_C99
|
||||
#define EA_COMPILER_IS_C99 0
|
||||
#endif
|
||||
#ifndef EA_COMPILER_IS_C99
|
||||
#define EA_COMPILER_IS_C99 0
|
||||
#endif
|
||||
#ifndef EA_COMPILER_HAS_C99_TYPES
|
||||
#define EA_COMPILER_HAS_C99_TYPES 0
|
||||
#endif
|
||||
#ifndef EA_COMPILER_IS_CPLUSPLUS
|
||||
#define EA_COMPILER_IS_CPLUSPLUS 0
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
#define PRINT_COMPILER_INFO(VAR) std::cout << #VAR << ": " << (VAR) << '\n'
|
||||
|
||||
PRINT_COMPILER_INFO(EA_COMPILER_VERSION);
|
||||
PRINT_COMPILER_INFO(EA_COMPILER_NAME);
|
||||
PRINT_COMPILER_INFO(EA_COMPILER_STRING);
|
||||
|
||||
std::cout << '\n';
|
||||
|
||||
PRINT_COMPILER_INFO(EA_PLATFORM_NAME);
|
||||
PRINT_COMPILER_INFO(EA_PLATFORM_DESCRIPTION);
|
||||
|
||||
std::cout << '\n';
|
||||
|
||||
PRINT_COMPILER_INFO(EA_COMPILER_IS_ANSIC);
|
||||
PRINT_COMPILER_INFO(EA_COMPILER_IS_C99);
|
||||
PRINT_COMPILER_INFO(EA_COMPILER_HAS_C99_TYPES);
|
||||
PRINT_COMPILER_INFO(EA_COMPILER_IS_CPLUSPLUS);
|
||||
|
||||
std::cout << '\n';
|
||||
|
||||
PRINT_COMPILER_INFO(EA_PLATFORM_PTR_SIZE);
|
||||
PRINT_COMPILER_INFO(EA_PLATFORM_WORD_SIZE);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
8
eabase/all/test_v1_package/CMakeLists.txt
Normal file
8
eabase/all/test_v1_package/CMakeLists.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
project(test_v1_package LANGUAGES CXX)
|
||||
|
||||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
conan_basic_setup(TARGETS)
|
||||
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/
|
||||
${CMAKE_CURRENT_BINARY_DIR}/test_package/)
|
||||
19
eabase/all/test_v1_package/conanfile.py
Normal file
19
eabase/all/test_v1_package/conanfile.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from conans import ConanFile, CMake
|
||||
from conan.tools.build import cross_building
|
||||
import os
|
||||
|
||||
|
||||
# legacy validation with Conan 1.x
|
||||
class TestPackageV1Conan(ConanFile):
|
||||
settings = "os", "arch", "compiler", "build_type"
|
||||
generators = "cmake", "cmake_find_package_multi"
|
||||
|
||||
def build(self):
|
||||
cmake = CMake(self)
|
||||
cmake.configure()
|
||||
cmake.build()
|
||||
|
||||
def test(self):
|
||||
if not cross_building(self):
|
||||
bin_path = os.path.join("bin", "test_package")
|
||||
self.run(bin_path, run_environment=True)
|
||||
Reference in New Issue
Block a user