From cf00f3744356ceb05d633afed970753b0dff1f8c Mon Sep 17 00:00:00 2001 From: tsoj Date: Thu, 21 Mar 2024 00:35:47 +0100 Subject: [PATCH 01/17] Update CMakeLists.txt --- src/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 87c510a..c507e6a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,10 +5,12 @@ project(Libataxx VERSION 1.0 LANGUAGES CXX) # Flags set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_FLAGS "-fPIC -Wall -Wextra -Wshadow") -set(CMAKE_CXX_FLAGS_DEBUG "-g") -set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG") -set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE) +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(CMAKE_CXX_FLAGS "-fPIC -Wall -Wextra -Wshadow") + set(CMAKE_CXX_FLAGS_DEBUG "-g") + set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG") + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE) +endif () # Default build type if(NOT CMAKE_BUILD_TYPE) From 02e4721fa4c05f047abe69df31ec0bfa1345caae Mon Sep 17 00:00:00 2001 From: tsoj Date: Thu, 21 Mar 2024 00:58:10 +0100 Subject: [PATCH 02/17] Update bitboard.hpp --- src/libataxx/bitboard.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libataxx/bitboard.hpp b/src/libataxx/bitboard.hpp index 8478f78..6254b15 100644 --- a/src/libataxx/bitboard.hpp +++ b/src/libataxx/bitboard.hpp @@ -3,6 +3,7 @@ #include #include +#include #include "square.hpp" namespace libataxx { @@ -38,7 +39,7 @@ class BitboardIterator { } [[nodiscard]] constexpr Square operator*() const noexcept { - const int n = __builtin_ctzll(data_); + const int n = std::countr_zero(data_); return Square{File{n % 8}, Rank{n / 8}}; } @@ -69,7 +70,7 @@ class Bitboard { } [[nodiscard]] constexpr int count() const noexcept { - return __builtin_popcountll(data_); + return std::popcount(data_); } constexpr void set(const Square &sq) noexcept { @@ -195,7 +196,7 @@ class Bitboard { } [[nodiscard]] constexpr int lsbll() const noexcept { - return __builtin_ctzll(data_); + return std::countr_zero(data_); } [[nodiscard]] constexpr Bitboard flip_vertical() const noexcept { From c137d7078d22b893980cac3744ef2e793176ce4b Mon Sep 17 00:00:00 2001 From: tsoj Date: Thu, 21 Mar 2024 00:58:39 +0100 Subject: [PATCH 03/17] Update tt.hpp --- examples/tt.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/tt.hpp b/examples/tt.hpp index 58043ad..6ca20d2 100644 --- a/examples/tt.hpp +++ b/examples/tt.hpp @@ -42,7 +42,9 @@ class TT { void prefetch(const std::uint64_t hash) const noexcept { const auto idx = index(hash); +#ifndef __GNUC__ __builtin_prefetch(&entries_[idx]); +#endif } private: From 941bdffe053d1055f0e7210f9c1c2bf3e31e400a Mon Sep 17 00:00:00 2001 From: tsoj Date: Thu, 21 Mar 2024 03:41:51 +0100 Subject: [PATCH 04/17] Update tt.hpp, fixed stupid thing --- examples/tt.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/tt.hpp b/examples/tt.hpp index 6ca20d2..58043ad 100644 --- a/examples/tt.hpp +++ b/examples/tt.hpp @@ -42,9 +42,7 @@ class TT { void prefetch(const std::uint64_t hash) const noexcept { const auto idx = index(hash); -#ifndef __GNUC__ __builtin_prefetch(&entries_[idx]); -#endif } private: From 10dc26f7ded801e8d6ec404d2f1b657e938657c9 Mon Sep 17 00:00:00 2001 From: tsoj Date: Thu, 21 Mar 2024 22:10:24 +0100 Subject: [PATCH 05/17] Update CMakeLists.txt --- src/CMakeLists.txt | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c507e6a..72be540 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,14 +3,18 @@ cmake_minimum_required(VERSION 3.12) # Project project(Libataxx VERSION 1.0 LANGUAGES CXX) -# Flags -set(CMAKE_CXX_STANDARD 20) -if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(CMAKE_CXX_FLAGS "-fPIC -Wall -Wextra -Wshadow") - set(CMAKE_CXX_FLAGS_DEBUG "-g") - set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG") - set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE) -endif () +target_compile_features(Foo PUBLIC cxx_std_20) + +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # MSVC doesn't need -fPIC as it's the default behavior + # Equivalent of -Wall -Wextra + add_compile_options(/W3) + # There's no direct equivalent for -Wshadow in MSVC +elif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + add_compile_options(-fPIC -Wall -Wextra -Wshadow) +else() + message(FATAL_ERROR "Compiler not explicitly supported: ${CMAKE_CXX_COMPILER_ID}" ) +endif() # Default build type if(NOT CMAKE_BUILD_TYPE) From dd2028652983ce62102c81ea6b672bf51e9f59c0 Mon Sep 17 00:00:00 2001 From: tsoj Date: Thu, 21 Mar 2024 22:10:31 +0100 Subject: [PATCH 06/17] Update CMakeLists.txt --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e0796c..23befe8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,18 @@ project( set_property(GLOBAL PROPERTY USE_FOLDERS ON) +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + set(CMAKE_CXX_FLAGS_DEBUG "/Zi /Ob0 /Od /RTC1") + set(CMAKE_CXX_FLAGS_RELEASE "/O2 /DNDEBUG") +elif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(CMAKE_CXX_FLAGS_DEBUG "-g") + set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG") +else() + message(FATAL_ERROR "Compiler not explicitly supported: ${CMAKE_CXX_COMPILER_ID}" ) +endif () + +set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE) + add_subdirectory(src) if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) From 4ee07c38a5628b7552a918ff00a9a87fe7ed96ef Mon Sep 17 00:00:00 2001 From: tsoj Date: Thu, 21 Mar 2024 22:18:39 +0100 Subject: [PATCH 07/17] Update CMakeLists.txt --- CMakeLists.txt | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 23befe8..8e0796c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,18 +9,6 @@ project( set_property(GLOBAL PROPERTY USE_FOLDERS ON) -if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - set(CMAKE_CXX_FLAGS_DEBUG "/Zi /Ob0 /Od /RTC1") - set(CMAKE_CXX_FLAGS_RELEASE "/O2 /DNDEBUG") -elif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(CMAKE_CXX_FLAGS_DEBUG "-g") - set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG") -else() - message(FATAL_ERROR "Compiler not explicitly supported: ${CMAKE_CXX_COMPILER_ID}" ) -endif () - -set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE) - add_subdirectory(src) if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) From 0ee439fa9f6bf38af10914b595f4ef6ae3314134 Mon Sep 17 00:00:00 2001 From: tsoj Date: Thu, 21 Mar 2024 22:21:48 +0100 Subject: [PATCH 08/17] Update CMakeLists.txt --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 72be540..d6c60d8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,14 +3,14 @@ cmake_minimum_required(VERSION 3.12) # Project project(Libataxx VERSION 1.0 LANGUAGES CXX) -target_compile_features(Foo PUBLIC cxx_std_20) +target_compile_features(objlib PUBLIC cxx_std_20) if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") # MSVC doesn't need -fPIC as it's the default behavior # Equivalent of -Wall -Wextra add_compile_options(/W3) # There's no direct equivalent for -Wshadow in MSVC -elif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") add_compile_options(-fPIC -Wall -Wextra -Wshadow) else() message(FATAL_ERROR "Compiler not explicitly supported: ${CMAKE_CXX_COMPILER_ID}" ) From f87a082a25fded6956429e53eca31f29b400e657 Mon Sep 17 00:00:00 2001 From: tsoj Date: Thu, 21 Mar 2024 22:25:23 +0100 Subject: [PATCH 09/17] Update CMakeLists.txt --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d6c60d8..b9b352f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,8 +3,6 @@ cmake_minimum_required(VERSION 3.12) # Project project(Libataxx VERSION 1.0 LANGUAGES CXX) -target_compile_features(objlib PUBLIC cxx_std_20) - if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") # MSVC doesn't need -fPIC as it's the default behavior # Equivalent of -Wall -Wextra @@ -40,6 +38,8 @@ add_library( set_fen.cpp ) +target_compile_features(objlib PUBLIC cxx_std_20) + # Add the static library add_library( ataxx_static From 8f1589c4b4615616ca2bc9b021b901daa985cb6d Mon Sep 17 00:00:00 2001 From: tsoj Date: Thu, 21 Mar 2024 22:57:19 +0100 Subject: [PATCH 10/17] Update CMakeLists.txt --- src/CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b9b352f..2475ace 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,6 +14,19 @@ else() message(FATAL_ERROR "Compiler not explicitly supported: ${CMAKE_CXX_COMPILER_ID}" ) endif() +# Compiler flags +# TODO not all all applications would want to use libataxx with these flags +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + set(CMAKE_CXX_FLAGS_DEBUG "/Zi /Ob0 /Od /RTC1") + set(CMAKE_CXX_FLAGS_RELEASE "/O2 /DNDEBUG") +elif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(CMAKE_CXX_FLAGS_DEBUG "-g") + set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG") +else() + message(FATAL_ERROR "Compiler not explicitly supported: ${CMAKE_CXX_COMPILER_ID}" ) +endif () +set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE) + # Default build type if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) From 14191565aa10f35713392047769b7fbfa6944700 Mon Sep 17 00:00:00 2001 From: tsoj Date: Thu, 21 Mar 2024 22:58:23 +0100 Subject: [PATCH 11/17] Update CMakeLists.txt --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2475ace..8eb25ef 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,7 +19,7 @@ endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(CMAKE_CXX_FLAGS_DEBUG "/Zi /Ob0 /Od /RTC1") set(CMAKE_CXX_FLAGS_RELEASE "/O2 /DNDEBUG") -elif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(CMAKE_CXX_FLAGS_DEBUG "-g") set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG") else() From 8d41622d5d495bb09acf0484e7e90b4395e53c84 Mon Sep 17 00:00:00 2001 From: tsoj Date: Thu, 21 Mar 2024 23:02:24 +0100 Subject: [PATCH 12/17] Update CMakeLists.txt --- src/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8eb25ef..773efaf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -7,14 +7,12 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") # MSVC doesn't need -fPIC as it's the default behavior # Equivalent of -Wall -Wextra add_compile_options(/W3) - # There's no direct equivalent for -Wshadow in MSVC elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") add_compile_options(-fPIC -Wall -Wextra -Wshadow) else() message(FATAL_ERROR "Compiler not explicitly supported: ${CMAKE_CXX_COMPILER_ID}" ) endif() -# Compiler flags # TODO not all all applications would want to use libataxx with these flags if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(CMAKE_CXX_FLAGS_DEBUG "/Zi /Ob0 /Od /RTC1") From c8a4d998fd6ae69323bb48f524cd218a0ffe0d5e Mon Sep 17 00:00:00 2001 From: tsoj Date: Thu, 21 Mar 2024 23:08:20 +0100 Subject: [PATCH 13/17] Update CMakeLists.txt --- examples/CMakeLists.txt | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 1dfd120..d161842 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -5,9 +5,27 @@ project(examples VERSION 1.0 LANGUAGES CXX) # Flags set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wshadow") -set(CMAKE_CXX_FLAGS_DEBUG "-g") -set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG") + +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # MSVC doesn't need -fPIC as it's the default behavior + # Equivalent of -Wall -Wextra + add_compile_options(/W3) +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + add_compile_options(-fPIC -Wall -Wextra -Wshadow) +else() + message(FATAL_ERROR "Compiler not explicitly supported: ${CMAKE_CXX_COMPILER_ID}" ) +endif() + +# TODO not all all applications would want to use libataxx with these flags +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + set(CMAKE_CXX_FLAGS_DEBUG "/Zi /Ob0 /Od /RTC1") + set(CMAKE_CXX_FLAGS_RELEASE "/O2 /DNDEBUG") +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(CMAKE_CXX_FLAGS_DEBUG "-g") + set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG") +else() + message(FATAL_ERROR "Compiler not explicitly supported: ${CMAKE_CXX_COMPILER_ID}" ) +endif () set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE) # Default build type From 19046ba6aed31ddce45d26fe0bcabfd72fad5c92 Mon Sep 17 00:00:00 2001 From: tsoj Date: Thu, 21 Mar 2024 23:08:39 +0100 Subject: [PATCH 14/17] Update CMakeLists.txt --- tests/CMakeLists.txt | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e0e13df..530070c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -5,9 +5,27 @@ project(tests VERSION 1.0 LANGUAGES CXX) # Flags set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wshadow") -set(CMAKE_CXX_FLAGS_DEBUG "-g") -set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG") + +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # MSVC doesn't need -fPIC as it's the default behavior + # Equivalent of -Wall -Wextra + add_compile_options(/W3) +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + add_compile_options(-fPIC -Wall -Wextra -Wshadow) +else() + message(FATAL_ERROR "Compiler not explicitly supported: ${CMAKE_CXX_COMPILER_ID}" ) +endif() + +# TODO not all all applications would want to use libataxx with these flags +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + set(CMAKE_CXX_FLAGS_DEBUG "/Zi /Ob0 /Od /RTC1") + set(CMAKE_CXX_FLAGS_RELEASE "/O2 /DNDEBUG") +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(CMAKE_CXX_FLAGS_DEBUG "-g") + set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG") +else() + message(FATAL_ERROR "Compiler not explicitly supported: ${CMAKE_CXX_COMPILER_ID}" ) +endif () set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE) # Default build type From 72179f2fe72544701b1768fa36d1908a81e898f3 Mon Sep 17 00:00:00 2001 From: tsoj Date: Thu, 21 Mar 2024 23:51:07 +0100 Subject: [PATCH 15/17] Update CMakeLists.txt --- tests/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 530070c..8ea5f13 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -16,7 +16,6 @@ else() message(FATAL_ERROR "Compiler not explicitly supported: ${CMAKE_CXX_COMPILER_ID}" ) endif() -# TODO not all all applications would want to use libataxx with these flags if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(CMAKE_CXX_FLAGS_DEBUG "/Zi /Ob0 /Od /RTC1") set(CMAKE_CXX_FLAGS_RELEASE "/O2 /DNDEBUG") From 181232f4c26fbdccaccfc1487c36663678bd179e Mon Sep 17 00:00:00 2001 From: tsoj Date: Thu, 21 Mar 2024 23:51:22 +0100 Subject: [PATCH 16/17] Update CMakeLists.txt --- examples/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index d161842..18728e3 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -16,7 +16,6 @@ else() message(FATAL_ERROR "Compiler not explicitly supported: ${CMAKE_CXX_COMPILER_ID}" ) endif() -# TODO not all all applications would want to use libataxx with these flags if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(CMAKE_CXX_FLAGS_DEBUG "/Zi /Ob0 /Od /RTC1") set(CMAKE_CXX_FLAGS_RELEASE "/O2 /DNDEBUG") From 38672bc7b68e2ca80b46859467cb43cc489e3e0b Mon Sep 17 00:00:00 2001 From: tsoj Date: Thu, 21 Mar 2024 23:51:46 +0100 Subject: [PATCH 17/17] Update CMakeLists.txt --- src/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 773efaf..71b0b84 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -13,7 +13,6 @@ else() message(FATAL_ERROR "Compiler not explicitly supported: ${CMAKE_CXX_COMPILER_ID}" ) endif() -# TODO not all all applications would want to use libataxx with these flags if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(CMAKE_CXX_FLAGS_DEBUG "/Zi /Ob0 /Od /RTC1") set(CMAKE_CXX_FLAGS_RELEASE "/O2 /DNDEBUG")