Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
arbCoding committed Jan 27, 2024
1 parent 089b803 commit 46b8918
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 53 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/cmake-windows-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,11 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install Catch2 v3 from source
run: |
git clone https://github.com/catchorg/Catch2.git
cd Catch2
git checkout v3.5.2
cmake -Bbuild -S. -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Debug
cmake --build build/ --target install
- name: Prep License File for Distribution
run: cp LICENSE License.txt

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=20 -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_CXX_EXTENSIONS=OFF -DCMAKE_CXX_FLAGS="/EHsc"
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=20 -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_CXX_EXTENSIONS=OFF -DCMAKE_CXX_FLAGS="/O2 /EHsc"

- name: Build
run: cmake --build ${{github.workspace}}/build --config Release
Expand Down
37 changes: 24 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,32 @@ FetchContent_Declare(xoshiro
GIT_REPOSITORY https://github.com/Reputeless/Xoshiro-cpp
GIT_TAG v1.1
SYSTEM)
FetchContent_MakeAvailable(xoshiro)
if (WIN32)
# Windows
FetchContent_Declare(Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2
GIT_TAG v3.5.2
SYSTEM)
FetchContent_MakeAvailable(xoshiro Catch2)
else()
# Unix & macOS
FetchContent_MakeAvailable(xoshiro)
# Provides location to search for Catch2 installation from source build
# build via:
# git clone https://github.com/catchorg/Catch2.git
# mkdir build && cd build
# cmake .. -DBUILD_TESTING=Off
# make && sudo make install
# Need to figure out how to get this working on Windows as well!
list(APPEND CMAKE_PREFIX_PATH
"/usr/local/lib64/cmake" # Linux
"/usr/local/lib/cmake" # macOS
"C:/Program Files (x86)/Catch2" # Windows
)
endif()

# Include Xoshiro since it doesn't have a CMakeLists.txt
include_directories(SYSTEM ${xoshiro_SOURCE_DIR})
# Provides location to search for Catch2 installation from source build
# build via:
# git clone https://github.com/catchorg/Catch2.git
# mkdir build && cd build
# cmake .. -DBUILD_TESTING=Off
# make && sudo make install
# Need to figure out how to get this working on Windows as well!
list(APPEND CMAKE_PREFIX_PATH
"/usr/local/lib64/cmake" # Linux
"/usr/local/lib/cmake" # macOS
"C:/Program Files (x86)/Catch2" # Windows
)
find_package(Catch2 3 CONFIG REQUIRED)
#==============================================================================
# sac-format
Expand Down
5 changes: 0 additions & 5 deletions src/benchmark.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
// Copyright 2023-2024 Alexander R. Blanchette

// Required for Catch2 compatibility on Windows
#if defined(_MSC_VER) || defined(__MINW32__)
#define _ITERATOR_DEBUG_LEVEL 2
#endif

#include "sac-format/sac_format.hpp"
#include "sac-format/util.hpp"
// Catch2 https://github.com/catchorg/Catch2/tree/v3.4.0
Expand Down
2 changes: 1 addition & 1 deletion src/examples/list_sac.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Alexander R. Blanchette
// Copyright 2023-2024 Alexander R. Blanchette

// sac-format
#include "sac-format/sac_format.hpp"
Expand Down
5 changes: 0 additions & 5 deletions src/tests/binary_conversions.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
// Copyright 2023-2024 Alexander R. Blanchette

// Required for Catch2 compatibility on Windows
#if defined(_MSC_VER) || defined(__MINW32__)
#define _ITERATOR_DEBUG_LEVEL 2
#endif

// sac-format
#include "sac-format/sac_format.hpp"
#include "sac-format/util.hpp"
Expand Down
5 changes: 0 additions & 5 deletions src/tests/constants.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
// Copyright 2023-2024 Alexander R. Blanchette

// Required for Catch2 compatibility on Windows
#if defined(_MSC_VER) || defined(__MINW32__)
#define _ITERATOR_DEBUG_LEVEL 2
#endif

// sac-format
#include "sac-format/sac_format.hpp"
// Standard Library
Expand Down
5 changes: 0 additions & 5 deletions src/tests/datetime.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
// Copyright 2023-2024 Alexander R. Blanchette

// Required for Catch2 compatibility on Windows
#if defined(_MSC_VER) || defined(__MINW32__)
#define _ITERATOR_DEBUG_LEVEL 2
#endif

// sac-format
#include "sac-format/sac_format.hpp"
#include "sac-format/util.hpp"
Expand Down
5 changes: 0 additions & 5 deletions src/tests/geometry.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
// Copyright 2023-2024 Alexander R. Blanchette

// Required for Catch2 compatibility on Windows
#if defined(_MSC_VER) || defined(__MINW32__)
#define _ITERATOR_DEBUG_LEVEL 2
#endif

// sac-format
#include "sac-format/sac_format.hpp"
#include "sac-format/util.hpp"
Expand Down
5 changes: 0 additions & 5 deletions src/tests/trace.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
// Copyright 2023-2024 Alexander R. Blanchette

// Required for Catch2 compatibility on Windows
#if defined(_MSC_VER) || defined(__MINW32__)
#define _ITERATOR_DEBUG_LEVEL 2
#endif

// sac-format
#include "sac-format/sac_format.hpp"
#include "sac-format/util.hpp"
Expand Down

0 comments on commit 46b8918

Please sign in to comment.