EAStdC (#3)
Conan Packaging / Package assimp/6.0.5 (push) Successful in 1m59s
Conan Packaging / Package cli11/2.6.2 (push) Successful in 24s
Conan Packaging / Package flatbuffers/25.12.19-2026-02-06-03fffb2-bigfoot (push) Successful in 44s
Conan Packaging / Package glm/1.0.3 (push) Successful in 17s
Conan Packaging / Package lodepng/cci.20260210 (push) Successful in 18s
Conan Packaging / Package meshoptimizer/1.2 (push) Successful in 20s
Conan Packaging / Package eabase/01082025 (push) Successful in 17s
Conan Packaging / Package imgui/1.92.8-docking (push) Successful in 26s
Conan Packaging / Package pixelmatch-cpp17/1.0.3 (push) Successful in 23s
Conan Packaging / Package spirv-cross/1.4.341.0 (push) Successful in 54s
Conan Packaging / Package spirv-headers/1.4.341.0 (push) Successful in 17s
Conan Packaging / Package eaassert/25082026 (push) Successful in 18s
Conan Packaging / Package eastl/3.27.01 (push) Successful in 21s
Conan Packaging / Package spirv-tools/1.4.341.0 (push) Successful in 2m19s
Conan Packaging / Package vulkan-memory-allocator/3.3.0 (push) Successful in 19s
Conan Packaging / Package mimalloc/3.3.2 (push) Successful in 21s
Conan Packaging / Package mold/2.41.0 (push) Successful in 4m56s
Conan Packaging / Package rapidhash/3.0 (push) Successful in 16s
Conan Packaging / Package sqlite3/3.53.3 (push) Successful in 40s
Conan Packaging / Package stduuid/1.2.3 (push) Successful in 32s
Conan Packaging / Package unordered_dense/4.8.1 (push) Successful in 17s
Conan Packaging / Package vulkan-headers/1.4.341.0 (push) Successful in 17s
Conan Packaging / Package eathread/25082026 (push) Successful in 19s
Conan Packaging / Package vulkan-utility-libraries/1.4.341.0 (push) Successful in 22s
Conan Packaging / Package glslang/1.4.341.0 (push) Successful in 2m42s
Conan Packaging / Package eastdc/25082026 (push) Successful in 23s
Conan Packaging / Package vulkan-validationlayers/1.4.341.0 (push) Successful in 5m52s
Conan Packaging / Package shaderc/2026.1 (push) Successful in 3m7s
Conan Packaging / Package assimp/6.0.5 (push) Successful in 1m59s
Conan Packaging / Package cli11/2.6.2 (push) Successful in 24s
Conan Packaging / Package flatbuffers/25.12.19-2026-02-06-03fffb2-bigfoot (push) Successful in 44s
Conan Packaging / Package glm/1.0.3 (push) Successful in 17s
Conan Packaging / Package lodepng/cci.20260210 (push) Successful in 18s
Conan Packaging / Package meshoptimizer/1.2 (push) Successful in 20s
Conan Packaging / Package eabase/01082025 (push) Successful in 17s
Conan Packaging / Package imgui/1.92.8-docking (push) Successful in 26s
Conan Packaging / Package pixelmatch-cpp17/1.0.3 (push) Successful in 23s
Conan Packaging / Package spirv-cross/1.4.341.0 (push) Successful in 54s
Conan Packaging / Package spirv-headers/1.4.341.0 (push) Successful in 17s
Conan Packaging / Package eaassert/25082026 (push) Successful in 18s
Conan Packaging / Package eastl/3.27.01 (push) Successful in 21s
Conan Packaging / Package spirv-tools/1.4.341.0 (push) Successful in 2m19s
Conan Packaging / Package vulkan-memory-allocator/3.3.0 (push) Successful in 19s
Conan Packaging / Package mimalloc/3.3.2 (push) Successful in 21s
Conan Packaging / Package mold/2.41.0 (push) Successful in 4m56s
Conan Packaging / Package rapidhash/3.0 (push) Successful in 16s
Conan Packaging / Package sqlite3/3.53.3 (push) Successful in 40s
Conan Packaging / Package stduuid/1.2.3 (push) Successful in 32s
Conan Packaging / Package unordered_dense/4.8.1 (push) Successful in 17s
Conan Packaging / Package vulkan-headers/1.4.341.0 (push) Successful in 17s
Conan Packaging / Package eathread/25082026 (push) Successful in 19s
Conan Packaging / Package vulkan-utility-libraries/1.4.341.0 (push) Successful in 22s
Conan Packaging / Package glslang/1.4.341.0 (push) Successful in 2m42s
Conan Packaging / Package eastdc/25082026 (push) Successful in 23s
Conan Packaging / Package vulkan-validationlayers/1.4.341.0 (push) Successful in 5m52s
Conan Packaging / Package shaderc/2026.1 (push) Successful in 3m7s
Reviewed-on: #3 Co-authored-by: Romain BOULLARD <romain.boullard@protonmail.com>
This commit was merged in pull request #3.
This commit is contained in:
+13
-21
@@ -62,8 +62,8 @@ jobs:
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Reset ccache stats
|
||||
run: ccache --zero-stats
|
||||
- name: SetUp Bigfoot Artifactory
|
||||
run: conan remote add bigfootpackages https://conan.romainboullard.com/artifactory/api/conan/BigfootPackages --force
|
||||
|
||||
- name: Run Conan packaging
|
||||
run: |
|
||||
@@ -82,9 +82,6 @@ jobs:
|
||||
conan upload ${{ matrix.package.name }}/${{ matrix.package.version }}@bigfootdev/${{ env.BRANCH_NAME }} \
|
||||
--only-recipe --remote=bigfootpackages
|
||||
|
||||
- name: Show ccache stats
|
||||
run: ccache --show-stats
|
||||
|
||||
conan-packages-tier2:
|
||||
needs: conan-packages-tier1
|
||||
runs-on: ubuntu-latest
|
||||
@@ -98,6 +95,8 @@ jobs:
|
||||
matrix:
|
||||
package: [
|
||||
{ name: "eastl", version: "3.27.01", location: "all", needs_pkg: "eabase" },
|
||||
{ name: "eaassert", version: "25082026", location: "all", needs_pkg: "eabase" },
|
||||
{ name: "eathread", version: "25082026", location: "all", needs_pkg: "eabase" },
|
||||
|
||||
{ name: "vulkan-utility-libraries", version: "1.4.341.0", location: "all" },
|
||||
{ name: "spirv-tools", version: "1.4.341.0", location: "all" },
|
||||
@@ -117,8 +116,8 @@ jobs:
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Reset ccache stats
|
||||
run: ccache --zero-stats
|
||||
- name: SetUp Bigfoot Artifactory
|
||||
run: conan remote add bigfootpackages https://conan.romainboullard.com/artifactory/api/conan/BigfootPackages --force
|
||||
|
||||
- name: Run Conan packaging
|
||||
run: |
|
||||
@@ -137,9 +136,6 @@ jobs:
|
||||
conan upload ${{ matrix.package.name }}/${{ matrix.package.version }}@bigfootdev/${{ env.BRANCH_NAME }} \
|
||||
--only-recipe --remote=bigfootpackages
|
||||
|
||||
- name: Show ccache stats
|
||||
run: ccache --show-stats
|
||||
|
||||
conan-packages-tier3:
|
||||
needs: conan-packages-tier2
|
||||
runs-on: ubuntu-latest
|
||||
@@ -152,6 +148,8 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
package: [
|
||||
{ name: "eastdc", version: "25082026", location: "all", needs_pkg: "eabase, eaassert, eathread" },
|
||||
|
||||
{ name: "glslang", version: "1.4.341.0", location: "all" },
|
||||
{ name: "vulkan-validationlayers", version: "1.4.341.0", location: "all" },
|
||||
]
|
||||
@@ -168,8 +166,8 @@ jobs:
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Reset ccache stats
|
||||
run: ccache --zero-stats
|
||||
- name: SetUp Bigfoot Artifactory
|
||||
run: conan remote add bigfootpackages https://conan.romainboullard.com/artifactory/api/conan/BigfootPackages --force
|
||||
|
||||
- name: Run Conan packaging
|
||||
run: |
|
||||
@@ -188,9 +186,6 @@ jobs:
|
||||
conan upload ${{ matrix.package.name }}/${{ matrix.package.version }}@bigfootdev/${{ env.BRANCH_NAME }} \
|
||||
--only-recipe --remote=bigfootpackages
|
||||
|
||||
- name: Show ccache stats
|
||||
run: ccache --show-stats
|
||||
|
||||
conan-packages-tier4:
|
||||
needs: conan-packages-tier3
|
||||
runs-on: ubuntu-latest
|
||||
@@ -218,8 +213,8 @@ jobs:
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Reset ccache stats
|
||||
run: ccache --zero-stats
|
||||
- name: SetUp Bigfoot Artifactory
|
||||
run: conan remote add bigfootpackages https://conan.romainboullard.com/artifactory/api/conan/BigfootPackages --force
|
||||
|
||||
- name: Run Conan packaging
|
||||
run: |
|
||||
@@ -236,7 +231,4 @@ jobs:
|
||||
CONAN_LOGIN_USERNAME=${ARTIFACTORY_USER} \
|
||||
CONAN_PASSWORD=${ARTIFACTORY_PASSWORD} \
|
||||
conan upload ${{ matrix.package.name }}/${{ matrix.package.version }}@bigfootdev/${{ env.BRANCH_NAME }} \
|
||||
--only-recipe --remote=bigfootpackages
|
||||
|
||||
- name: Show ccache stats
|
||||
run: ccache --show-stats
|
||||
--only-recipe --remote=bigfootpackages
|
||||
@@ -0,0 +1,9 @@
|
||||
sources:
|
||||
"25082026":
|
||||
url: "https://github.com/electronicarts/EAAssert/archive/e5e181255de2e883dd1f987c78ccc42ac81d3bca.zip"
|
||||
sha256: "72940e194f00466d23aac969b129819f9538aa716bfacfbc1d3a5d5ad235a5b3"
|
||||
patches:
|
||||
"25082026":
|
||||
- patch_file: "patches/25082026-0001-use-conan.patch"
|
||||
patch_description: "bump cmake_minimum_required past what CMake >= 4 accepts, drop the submodule-only CommonCppFlags include, use cci's EABase, add install definitions"
|
||||
patch_type: "conan"
|
||||
@@ -0,0 +1,81 @@
|
||||
import os
|
||||
|
||||
from conan import ConanFile
|
||||
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
|
||||
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir
|
||||
|
||||
required_conan_version = ">=1.52.0"
|
||||
|
||||
|
||||
class EAAssertConan(ConanFile):
|
||||
name = "eaassert"
|
||||
description = "EAAssert is a lightweight EA runtime assertion library."
|
||||
topics = ("eastl", "assert")
|
||||
license = "BSD-3-Clause"
|
||||
url = "https://github.com/conan-io/conan-center-index"
|
||||
homepage = "https://github.com/electronicarts/EAAssert"
|
||||
|
||||
package_type = "library"
|
||||
settings = "os", "arch", "compiler", "build_type"
|
||||
options = {
|
||||
"shared": [True, False],
|
||||
"fPIC": [True, False],
|
||||
}
|
||||
default_options = {
|
||||
"shared": False,
|
||||
"fPIC": True,
|
||||
}
|
||||
|
||||
def export_sources(self):
|
||||
export_conandata_patches(self)
|
||||
|
||||
def config_options(self):
|
||||
if self.settings.os == "Windows":
|
||||
del self.options.fPIC
|
||||
|
||||
def configure(self):
|
||||
if self.options.shared:
|
||||
self.options.rm_safe("fPIC")
|
||||
|
||||
def layout(self):
|
||||
cmake_layout(self, src_folder="src")
|
||||
|
||||
def requirements(self):
|
||||
self.requires(f"eabase/01082025@{self.user}/{self.channel}", transitive_headers=True)
|
||||
|
||||
def source(self):
|
||||
get(self, **self.conan_data["sources"][self.version], strip_root=True)
|
||||
|
||||
def generate(self):
|
||||
tc = CMakeToolchain(self)
|
||||
tc.generate()
|
||||
CMakeDeps(self).generate()
|
||||
|
||||
def build(self):
|
||||
apply_conandata_patches(self)
|
||||
cmake = CMake(self)
|
||||
cmake.configure()
|
||||
cmake.build()
|
||||
|
||||
def package(self):
|
||||
copy(
|
||||
self,
|
||||
"LICENSE",
|
||||
src=self.source_folder,
|
||||
dst=os.path.join(self.package_folder, "licenses"),
|
||||
)
|
||||
cmake = CMake(self)
|
||||
cmake.install()
|
||||
rmdir(self, os.path.join(self.package_folder, "doc"))
|
||||
|
||||
def package_info(self):
|
||||
self.cpp_info.libs = ["EAAssert"]
|
||||
|
||||
self.cpp_info.set_property("cmake_file_name", "EAAssert")
|
||||
self.cpp_info.set_property("cmake_target_name", "EAAssert::EAAssert")
|
||||
|
||||
# TODO: to remove in conan v2 once cmake_find_package_* generators removed
|
||||
self.cpp_info.filenames["cmake_find_package"] = "EAAssert"
|
||||
self.cpp_info.filenames["cmake_find_package_multi"] = "EAAssert"
|
||||
self.cpp_info.names["cmake_find_package"] = "EAAssert"
|
||||
self.cpp_info.names["cmake_find_package_multi"] = "EAAssert"
|
||||
@@ -0,0 +1,39 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index a60892b..02619df 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(EAAssert CXX)
|
||||
|
||||
#-------------------------------------------------------------------------------------------
|
||||
@@ -13,7 +13,6 @@ option(EAASSERT_BUILD_TESTS "Enable generation of build files for tests" OFF)
|
||||
# Compiler Flags
|
||||
#-------------------------------------------------------------------------------------------
|
||||
set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/test/packages/EASTL/scripts/CMake")
|
||||
-include(CommonCppFlags)
|
||||
|
||||
#-------------------------------------------------------------------------------------------
|
||||
# Library definition
|
||||
@@ -41,5 +40,16 @@ target_include_directories(EAAssert PUBLIC include)
|
||||
#-------------------------------------------------------------------------------------------
|
||||
# Package Dependencies
|
||||
#-------------------------------------------------------------------------------------------
|
||||
-target_link_libraries(EAAssert EABase)
|
||||
+find_package(EABase REQUIRED CONFIG)
|
||||
+target_link_libraries(EAAssert EABase::EABase)
|
||||
+
|
||||
+#-------------------------------------------------------------------------------------------
|
||||
+# Installation
|
||||
+#-------------------------------------------------------------------------------------------
|
||||
+include(GNUInstallDirs)
|
||||
+install(TARGETS EAAssert
|
||||
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
+install(DIRECTORY include/EAAssert DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
project(test_package CXX)
|
||||
|
||||
find_package(EAAssert REQUIRED CONFIG)
|
||||
|
||||
add_executable(${PROJECT_NAME} test_package.cpp)
|
||||
target_link_libraries(${PROJECT_NAME} EAAssert::EAAssert)
|
||||
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
|
||||
|
||||
# Force the assert path on regardless of build_type - we're testing the failure-callback mechanism
|
||||
# itself, not whether asserts happen to be enabled for this configuration.
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE EA_ASSERT_ENABLED=1)
|
||||
@@ -0,0 +1,26 @@
|
||||
from conan import ConanFile
|
||||
from conan.tools.build import can_run
|
||||
from conan.tools.cmake import cmake_layout, CMake
|
||||
import os
|
||||
|
||||
|
||||
class TestPackageConan(ConanFile):
|
||||
settings = "os", "arch", "compiler", "build_type"
|
||||
generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv"
|
||||
test_type = "explicit"
|
||||
|
||||
def requirements(self):
|
||||
self.requires(self.tested_reference_str)
|
||||
|
||||
def layout(self):
|
||||
cmake_layout(self)
|
||||
|
||||
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")
|
||||
@@ -0,0 +1,31 @@
|
||||
#include <EAAssert/eaassert.h>
|
||||
|
||||
#include <cstdarg>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
||||
namespace
|
||||
{
|
||||
bool gCallbackInvoked = false;
|
||||
|
||||
bool TestFailureCallback(const char*, const char*, int, const char*, const char*, va_list)
|
||||
{
|
||||
gCallbackInvoked = true;
|
||||
return false; // Don't break into the debugger.
|
||||
}
|
||||
} // namespace
|
||||
|
||||
int main()
|
||||
{
|
||||
EA::Assert::SetFailureCallback(&TestFailureCallback);
|
||||
|
||||
EA_ASSERT(1 == 2); // Deliberately false, to exercise the failure callback.
|
||||
|
||||
if (!gCallbackInvoked)
|
||||
{
|
||||
std::fprintf(stderr, "EA_ASSERT did not invoke the failure callback\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
versions:
|
||||
"25082026":
|
||||
folder: "all"
|
||||
@@ -0,0 +1,9 @@
|
||||
sources:
|
||||
"25082026":
|
||||
url: "https://github.com/electronicarts/EAStdC/archive/fbcc34e89c63636054334888f3a5bd7ac2fd4b76.zip"
|
||||
sha256: "023ddb703c824d2e7a9a670b8d5f4a9d9989e07b068f148448c6bb87402bd67d"
|
||||
patches:
|
||||
"25082026":
|
||||
- patch_file: "patches/25082026-0001-use-conan.patch"
|
||||
patch_description: "bump cmake_minimum_required past what CMake >= 4 accepts, drop the submodule-only CommonCppFlags include, use cci's EABase/EAAssert/EAThread, add install definitions"
|
||||
patch_type: "conan"
|
||||
@@ -0,0 +1,84 @@
|
||||
import os
|
||||
|
||||
from conan import ConanFile
|
||||
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
|
||||
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir
|
||||
|
||||
required_conan_version = ">=1.52.0"
|
||||
|
||||
|
||||
class EAStdCConan(ConanFile):
|
||||
name = "eastdc"
|
||||
description = "EAStdC (EA Standard C) is a package that implements much of the functionality of standard C " \
|
||||
"and C++ libraries, but with an emphasis on speed and efficiency and, secondarily, safety."
|
||||
topics = ("eastl", "stdc")
|
||||
license = "BSD-3-Clause"
|
||||
url = "https://github.com/conan-io/conan-center-index"
|
||||
homepage = "https://github.com/electronicarts/EAStdC"
|
||||
|
||||
package_type = "library"
|
||||
settings = "os", "arch", "compiler", "build_type"
|
||||
options = {
|
||||
"shared": [True, False],
|
||||
"fPIC": [True, False],
|
||||
}
|
||||
default_options = {
|
||||
"shared": False,
|
||||
"fPIC": True,
|
||||
}
|
||||
|
||||
def export_sources(self):
|
||||
export_conandata_patches(self)
|
||||
|
||||
def config_options(self):
|
||||
if self.settings.os == "Windows":
|
||||
del self.options.fPIC
|
||||
|
||||
def configure(self):
|
||||
if self.options.shared:
|
||||
self.options.rm_safe("fPIC")
|
||||
|
||||
def layout(self):
|
||||
cmake_layout(self, src_folder="src")
|
||||
|
||||
def requirements(self):
|
||||
self.requires(f"eabase/01082025@{self.user}/{self.channel}", transitive_headers=True)
|
||||
self.requires(f"eaassert/25082026@{self.user}/{self.channel}", transitive_headers=True)
|
||||
self.requires(f"eathread/25082026@{self.user}/{self.channel}", transitive_headers=True)
|
||||
|
||||
def source(self):
|
||||
get(self, **self.conan_data["sources"][self.version], strip_root=True)
|
||||
|
||||
def generate(self):
|
||||
tc = CMakeToolchain(self)
|
||||
tc.generate()
|
||||
CMakeDeps(self).generate()
|
||||
|
||||
def build(self):
|
||||
apply_conandata_patches(self)
|
||||
cmake = CMake(self)
|
||||
cmake.configure()
|
||||
cmake.build()
|
||||
|
||||
def package(self):
|
||||
copy(
|
||||
self,
|
||||
"LICENSE",
|
||||
src=self.source_folder,
|
||||
dst=os.path.join(self.package_folder, "licenses"),
|
||||
)
|
||||
cmake = CMake(self)
|
||||
cmake.install()
|
||||
rmdir(self, os.path.join(self.package_folder, "doc"))
|
||||
|
||||
def package_info(self):
|
||||
self.cpp_info.libs = ["EAStdC"]
|
||||
|
||||
self.cpp_info.set_property("cmake_file_name", "EAStdC")
|
||||
self.cpp_info.set_property("cmake_target_name", "EAStdC::EAStdC")
|
||||
|
||||
# TODO: to remove in conan v2 once cmake_find_package_* generators removed
|
||||
self.cpp_info.filenames["cmake_find_package"] = "EAStdC"
|
||||
self.cpp_info.filenames["cmake_find_package_multi"] = "EAStdC"
|
||||
self.cpp_info.names["cmake_find_package"] = "EAStdC"
|
||||
self.cpp_info.names["cmake_find_package_multi"] = "EAStdC"
|
||||
@@ -0,0 +1,43 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 9bf3131..36ab616 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(EAStdC CXX)
|
||||
|
||||
#-------------------------------------------------------------------------------------------
|
||||
@@ -13,7 +13,6 @@ option(EASTDC_BUILD_TESTS "Enable generation of build files for tests" OFF)
|
||||
# Compiler Flags
|
||||
#-------------------------------------------------------------------------------------------
|
||||
set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/test/packages/EASTL/scripts/CMake")
|
||||
-include(CommonCppFlags)
|
||||
|
||||
#-------------------------------------------------------------------------------------------
|
||||
# Library definition
|
||||
@@ -41,7 +40,18 @@ target_include_directories(EAStdC PUBLIC include)
|
||||
#-------------------------------------------------------------------------------------------
|
||||
# Dependencies
|
||||
#-------------------------------------------------------------------------------------------
|
||||
-target_link_libraries(EAStdC EABase)
|
||||
-target_link_libraries(EAStdC EAAssert)
|
||||
-target_link_libraries(EAStdC EAThread)
|
||||
+find_package(EABase REQUIRED CONFIG)
|
||||
+find_package(EAAssert REQUIRED CONFIG)
|
||||
+find_package(EAThread REQUIRED CONFIG)
|
||||
+target_link_libraries(EAStdC EABase::EABase EAAssert::EAAssert EAThread::EAThread)
|
||||
+
|
||||
+#-------------------------------------------------------------------------------------------
|
||||
+# Installation
|
||||
+#-------------------------------------------------------------------------------------------
|
||||
+include(GNUInstallDirs)
|
||||
+install(TARGETS EAStdC
|
||||
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
+install(DIRECTORY include/EAStdC DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
project(test_package CXX)
|
||||
|
||||
find_package(EAStdC REQUIRED CONFIG)
|
||||
|
||||
add_executable(${PROJECT_NAME} test_package.cpp)
|
||||
target_link_libraries(${PROJECT_NAME} EAStdC::EAStdC)
|
||||
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
|
||||
@@ -0,0 +1,26 @@
|
||||
from conan import ConanFile
|
||||
from conan.tools.build import can_run
|
||||
from conan.tools.cmake import cmake_layout, CMake
|
||||
import os
|
||||
|
||||
|
||||
class TestPackageConan(ConanFile):
|
||||
settings = "os", "arch", "compiler", "build_type"
|
||||
generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv"
|
||||
test_type = "explicit"
|
||||
|
||||
def requirements(self):
|
||||
self.requires(self.tested_reference_str)
|
||||
|
||||
def layout(self):
|
||||
cmake_layout(self)
|
||||
|
||||
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")
|
||||
@@ -0,0 +1,40 @@
|
||||
#include <EAStdC/EASprintf.h>
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
void* operator new[](size_t size,
|
||||
const char* /*pName*/,
|
||||
int /*flags*/,
|
||||
unsigned /*debugFlags*/,
|
||||
const char* /*file*/,
|
||||
int /*line*/)
|
||||
{
|
||||
return new uint8_t[size];
|
||||
}
|
||||
void* operator new[](size_t size,
|
||||
size_t /*alignment*/,
|
||||
size_t /*alignmentOffset*/,
|
||||
const char* /*pName*/,
|
||||
int /*flags*/,
|
||||
unsigned /*debugFlags*/,
|
||||
const char* /*file*/,
|
||||
int /*line*/)
|
||||
{
|
||||
return new uint8_t[size];
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
char buffer[64];
|
||||
const int result = EA::StdC::Snprintf(buffer, sizeof(buffer), "%s-%d", "hello", 42);
|
||||
|
||||
if ((result != 8) || (std::strcmp(buffer, "hello-42") != 0))
|
||||
{
|
||||
std::fprintf(stderr, "EA::StdC::Snprintf produced unexpected output: \"%s\" (result=%d)\n", buffer, result);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
versions:
|
||||
"25082026":
|
||||
folder: "all"
|
||||
@@ -0,0 +1,12 @@
|
||||
sources:
|
||||
"25082026":
|
||||
url: "https://github.com/electronicarts/EAThread/archive/a77e2276a3fe1489a7c6206c3f77ea10f7a5daf7.zip"
|
||||
sha256: "19f6ed95e38e9580bcdcd8190a31952b9d27af7a7b27a9b86802cadb44ac4579"
|
||||
patches:
|
||||
"25082026":
|
||||
- patch_file: "patches/25082026-0001-use-conan.patch"
|
||||
patch_description: "drop the submodule-only CommonCppFlags include and the FetchContent EABase pull, use cci's EABase, add install definitions"
|
||||
patch_type: "conan"
|
||||
- patch_file: "patches/25082026-0002-fix-char8t-thread-naming.patch"
|
||||
patch_description: "unix thread-naming code used char8_t as a stand-in for plain char (a pre-C++20 convention) - fails to compile against char*-based strncpy/prctl/pthread_setname_np now that char8_t is a real, distinct type"
|
||||
patch_type: "portability"
|
||||
@@ -0,0 +1,83 @@
|
||||
import os
|
||||
|
||||
from conan import ConanFile
|
||||
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
|
||||
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir
|
||||
|
||||
required_conan_version = ">=1.52.0"
|
||||
|
||||
|
||||
class EAThreadConan(ConanFile):
|
||||
name = "eathread"
|
||||
description = "EAThread is a C++ library that provides a platform-independent interface for threading."
|
||||
topics = ("eastl", "threading")
|
||||
license = "BSD-3-Clause"
|
||||
url = "https://github.com/conan-io/conan-center-index"
|
||||
homepage = "https://github.com/electronicarts/EAThread"
|
||||
|
||||
package_type = "library"
|
||||
settings = "os", "arch", "compiler", "build_type"
|
||||
options = {
|
||||
"shared": [True, False],
|
||||
"fPIC": [True, False],
|
||||
}
|
||||
default_options = {
|
||||
"shared": False,
|
||||
"fPIC": True,
|
||||
}
|
||||
|
||||
def export_sources(self):
|
||||
export_conandata_patches(self)
|
||||
|
||||
def config_options(self):
|
||||
if self.settings.os == "Windows":
|
||||
del self.options.fPIC
|
||||
|
||||
def configure(self):
|
||||
if self.options.shared:
|
||||
self.options.rm_safe("fPIC")
|
||||
|
||||
def layout(self):
|
||||
cmake_layout(self, src_folder="src")
|
||||
|
||||
def requirements(self):
|
||||
self.requires(f"eabase/01082025@{self.user}/{self.channel}", transitive_headers=True)
|
||||
|
||||
def source(self):
|
||||
get(self, **self.conan_data["sources"][self.version], strip_root=True)
|
||||
|
||||
def generate(self):
|
||||
tc = CMakeToolchain(self)
|
||||
tc.generate()
|
||||
CMakeDeps(self).generate()
|
||||
|
||||
def build(self):
|
||||
apply_conandata_patches(self)
|
||||
cmake = CMake(self)
|
||||
cmake.configure()
|
||||
cmake.build()
|
||||
|
||||
def package(self):
|
||||
copy(
|
||||
self,
|
||||
"LICENSE",
|
||||
src=self.source_folder,
|
||||
dst=os.path.join(self.package_folder, "licenses"),
|
||||
)
|
||||
cmake = CMake(self)
|
||||
cmake.install()
|
||||
rmdir(self, os.path.join(self.package_folder, "doc"))
|
||||
|
||||
def package_info(self):
|
||||
self.cpp_info.libs = ["EAThread"]
|
||||
if self.settings.os in ["Linux", "FreeBSD"]:
|
||||
self.cpp_info.system_libs.append("pthread")
|
||||
|
||||
self.cpp_info.set_property("cmake_file_name", "EAThread")
|
||||
self.cpp_info.set_property("cmake_target_name", "EAThread::EAThread")
|
||||
|
||||
# TODO: to remove in conan v2 once cmake_find_package_* generators removed
|
||||
self.cpp_info.filenames["cmake_find_package"] = "EAThread"
|
||||
self.cpp_info.filenames["cmake_find_package_multi"] = "EAThread"
|
||||
self.cpp_info.names["cmake_find_package"] = "EAThread"
|
||||
self.cpp_info.names["cmake_find_package_multi"] = "EAThread"
|
||||
@@ -0,0 +1,40 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 7884456..6d51ebc 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -14,7 +14,6 @@ option(EATHREAD_BUILD_TESTS "Enable generation of build files for tests" OFF)
|
||||
# Compiler Flags (TODO: do we really need this?)
|
||||
#-------------------------------------------------------------------------------------------
|
||||
set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/scripts/Cmake" CACHE INTERNAL "Inject path to CommonCppFlags")
|
||||
-include(CommonCppFlags)
|
||||
|
||||
#-------------------------------------------------------------------------------------------
|
||||
# Library definition
|
||||
@@ -36,16 +35,18 @@ target_include_directories(EAThread PUBLIC include)
|
||||
#-------------------------------------------------------------------------------------------
|
||||
# Package Dependencies
|
||||
#-------------------------------------------------------------------------------------------
|
||||
-FetchContent_Declare(
|
||||
- EABase
|
||||
- GIT_REPOSITORY https://github.com/electronicarts/EABase.git
|
||||
- GIT_TAG 123363eb82e132c0181ac53e43226d8ee76dea12
|
||||
- GIT_SUBMODULES "" # This should be temporary until we update the cyclic submodule dependencies in EABase.
|
||||
-)
|
||||
+find_package(EABase REQUIRED CONFIG)
|
||||
+target_link_libraries(EAThread EABase::EABase)
|
||||
|
||||
-FetchContent_MakeAvailable(EABase)
|
||||
-
|
||||
-target_link_libraries(EAThread EABase)
|
||||
+#-------------------------------------------------------------------------------------------
|
||||
+# Installation
|
||||
+#-------------------------------------------------------------------------------------------
|
||||
+include(GNUInstallDirs)
|
||||
+install(TARGETS EAThread
|
||||
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
+install(DIRECTORY include/eathread DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
if(EATHREAD_BUILD_TESTS)
|
||||
add_subdirectory(test)
|
||||
@@ -0,0 +1,31 @@
|
||||
diff --git a/source/unix/eathread_unix.cpp b/source/unix/eathread_unix.cpp
|
||||
index 5be260a..f716caf 100644
|
||||
--- a/source/unix/eathread_unix.cpp
|
||||
+++ b/source/unix/eathread_unix.cpp
|
||||
@@ -402,7 +402,7 @@
|
||||
// This function is not currently used if the thread name can be set from any other thread
|
||||
#if !EATHREAD_OTHER_THREAD_NAMING_SUPPORTED
|
||||
|
||||
- void SetCurrentThreadName(const char8_t* pName)
|
||||
+ void SetCurrentThreadName(const char* pName)
|
||||
{
|
||||
#if defined(EA_PLATFORM_LINUX)
|
||||
// http://manpages.courier-mta.org/htmlman2/prctl.2.html
|
||||
@@ -417,7 +417,7 @@
|
||||
// (/proc/$PID/task/$TID/comm on newer kernels, /proc/$PID/task/$TID/stat's second field
|
||||
// on older kernels), and hence distinguish which thread might be responsible for the high
|
||||
// CPU load or similar problems.
|
||||
- char8_t nameBuf[16]; // Limited to 16 bytes, null terminated if < 16 bytes
|
||||
+ char nameBuf[16]; // Limited to 16 bytes, null terminated if < 16 bytes
|
||||
strncpy(nameBuf, pName, sizeof(nameBuf));
|
||||
nameBuf[15] = 0;
|
||||
prctl(PR_SET_NAME, (unsigned long)nameBuf, 0, 0, 0);
|
||||
@@ -434,7 +434,7 @@
|
||||
if(pthread_setname_np_ptr)
|
||||
{
|
||||
// Mac OS X does not expose the length limit of the name, so hardcode it.
|
||||
- char8_t nameBuf[63]; // It is not clear what the size limit actually is, though 63 is known to work because it was seen on the Internet.
|
||||
+ char nameBuf[63]; // It is not clear what the size limit actually is, though 63 is known to work because it was seen on the Internet.
|
||||
strncpy(nameBuf, pName, sizeof(nameBuf));
|
||||
nameBuf[62] = 0;
|
||||
pthread_setname_np_ptr(nameBuf);
|
||||
@@ -0,0 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
project(test_package CXX)
|
||||
|
||||
find_package(EAThread REQUIRED CONFIG)
|
||||
|
||||
add_executable(${PROJECT_NAME} test_package.cpp)
|
||||
target_link_libraries(${PROJECT_NAME} EAThread::EAThread)
|
||||
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
|
||||
@@ -0,0 +1,26 @@
|
||||
from conan import ConanFile
|
||||
from conan.tools.build import can_run
|
||||
from conan.tools.cmake import cmake_layout, CMake
|
||||
import os
|
||||
|
||||
|
||||
class TestPackageConan(ConanFile):
|
||||
settings = "os", "arch", "compiler", "build_type"
|
||||
generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv"
|
||||
test_type = "explicit"
|
||||
|
||||
def requirements(self):
|
||||
self.requires(self.tested_reference_str)
|
||||
|
||||
def layout(self):
|
||||
cmake_layout(self)
|
||||
|
||||
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")
|
||||
@@ -0,0 +1,31 @@
|
||||
#include <eathread/eathread_thread.h>
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
||||
namespace
|
||||
{
|
||||
intptr_t Increment(void* pContext)
|
||||
{
|
||||
int* const pValue = static_cast<int*>(pContext);
|
||||
*pValue += 1;
|
||||
return 0;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
int main()
|
||||
{
|
||||
int value = 0;
|
||||
|
||||
EA::Thread::Thread thread;
|
||||
thread.Begin(&Increment, &value);
|
||||
thread.WaitForEnd();
|
||||
|
||||
if (value != 1)
|
||||
{
|
||||
std::fprintf(stderr, "Thread did not run as expected (value=%d)\n", value);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
versions:
|
||||
"25082026":
|
||||
folder: "all"
|
||||
Reference in New Issue
Block a user