Initial commit
This commit is contained in:
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;
|
||||
}
|
||||
Reference in New Issue
Block a user