From 98b83a29b29ee83fc060793a923f777f03317501 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Wed, 24 Apr 2024 15:50:55 +0900 Subject: [PATCH] Add CMakeLists.txt --- CMakeLists.txt | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..3dbb949 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.22.1) +project(KoreanNumbers CXX) + +set(KoreanNumbers_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp") + +add_executable(KoreanNumbers ${KoreanNumbers_SOURCES}) + +if(NOT DEFINED CMAKE_BUILD_TYPE OR "${CMAKE_BUILD_TYPE}" STREQUAL "") + message("Defaulting to \"Debug\" build type.") + set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type" FORCE) +else() + message("Using build type \"${CMAKE_BUILD_TYPE}\".") +endif() + +target_compile_options(KoreanNumbers PUBLIC +$,-Og,-fno-delete-null-pointer-checks -fno-strict-overflow -fno-strict-aliasing -ftrivial-auto-var-init=zero> +-Wall -Wformat -Wformat=2 -Wconversion -Wimplicit-fallthrough +-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 +-D_GLIBCXX_ASSERTIONS +-fstrict-flex-arrays=3 +-fstack-clash-protection -fstack-protector-strong +-Wl,-z,nodlopen -Wl,-z,noexecstack +-Wl,-z,relro -Wl,-z,now +-fPIE +) + +target_link_options(KoreanNumbers PUBLIC +$,-Og,-fno-delete-null-pointer-checks -fno-strict-overflow -fno-strict-aliasing -ftrivial-auto-var-init=zero> +-Wall -Wformat -Wformat=2 -Wconversion -Wimplicit-fallthrough +-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 +-D_GLIBCXX_ASSERTIONS +-fstrict-flex-arrays=3 +-fstack-clash-protection -fstack-protector-strong +-Wl,-z,nodlopen -Wl,-z,noexecstack +-Wl,-z,relro -Wl,-z,now +-fPIE +-pie +) + +target_compile_features(KoreanNumbers PUBLIC cxx_std_20)