Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #372626

Closed
sanaasim opened this issue Jan 10, 2025 · 2 comments
Closed

test #372626

sanaasim opened this issue Jan 10, 2025 · 2 comments
Labels
0.kind: bug Something is broken

Comments

@sanaasim
Copy link

cmake_minimum_required(VERSION 3.15)

Project Name

project(SplLogSample VERSION 1.0 LANGUAGES CXX)

Specify C++ standard

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

Set default build type to Release

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

Find fmt library

find_package(fmt REQUIRED)

Include fmt as a target

add_executable(SplLog_Sample.bin main.cpp)

Link libraries

target_link_libraries(SplLog_Sample.bin PRIVATE fmt::fmt)

Enable warnings

target_compile_options(SplLog_Sample.bin PRIVATE -Wall -Wextra -Wpedantic -Werror)

Set libc++ for Clang

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(SplLog_Sample.bin PRIVATE -stdlib=libc++)
target_link_options(SplLog_Sample.bin PRIVATE -stdlib=libc++ -lc++abi)
endif()

#include <fmt/core.h>
#include <fmt/chrono.h>
#include
#include

int main() {
// Display a formatted message
fmt::print("Hello, {fmt}!\n");

// Display current time using fmt
auto now = std::chrono::system_clock::now();
fmt::print("Current time: {:%Y-%m-%d %H:%M:%S}\n", now);

// End program
std::cout << "Program finished successfully!" << std::endl;

return 0;

}

./SplLog_Sample.bin

rm -rf build
mkdir build
cd build
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -G Ninja ..
ninja

@sanaasim sanaasim added the 0.kind: bug Something is broken label Jan 10, 2025
@pluiedev
Copy link
Contributor

What?

@eclairevoyant
Copy link
Contributor

It's a bot probably, just close it.

@aucub aucub closed this as not planned Won't fix, can't repro, duplicate, stale Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

4 participants