Skip to content
Snippets Groups Projects
Unverified Commit f3fe7e83 authored by Joris Vaillant's avatar Joris Vaillant Committed by GitHub
Browse files

Merge pull request #640 from jorisv/topic/nominmax

Add NOMINMAX definition to avoid Windows build issue
parents cf759661 d2767b74
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,10 @@ jobs:
environment: all-clang-cl
cxx_options: ''
build_type: Release
- os: windows-latest
environment: default
cxx_options: ''
build_type: Debug
steps:
- uses: actions/checkout@v4
......@@ -83,7 +87,12 @@ jobs:
COAL_BUILD_TYPE: ${{ matrix.build_type }}
COAL_CXX_FLAGS: ${{ matrix.cxx_options }}
run: |
pixi run -e ${{ matrix.environment }} test
pixi run -e ${{ matrix.environment }} build
- name: Test Coal [MacOS/Linux/Windows]
if: ${{ ! (contains(matrix.os, 'windows') && matrix.build_type == 'Debug') }}
run: |
pixi run -e ${{ matrix.environment }} ctest --test-dir build --output-on-failure
check:
if: always()
......
......@@ -15,6 +15,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added
- Add Pixi support ([#629](https://github.com/coal-library/coal/pull/629))
### Changed
- Set NOMINMAX as a public definitions on Windows ([#640](https://github.com/coal-library/coal/pull/640))
## [3.0.0] - 2024-11-20
### Added
......
......@@ -200,9 +200,14 @@ if(UNIX)
set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${${PROJECT_NAME}_INSTALL_RPATH}")
endif()
IF(MSVC)
target_compile_options(${PROJECT_NAME} PUBLIC "/bigobj")
ENDIF()
cxx_flags_by_compiler_frontend(
MSVC "/bigobj"
OUTPUT PUBLIC_OPTIONS
FILTER)
target_compile_options(${PROJECT_NAME} PUBLIC ${PUBLIC_OPTIONS})
cxx_flags_by_compiler_frontend(MSVC "NOMINMAX" OUTPUT PUBLIC_DEFINITIONS)
target_compile_definitions(${PROJECT_NAME} INTERFACE ${PUBLIC_DEFINITIONS})
# IDE sources and headers sorting
ADD_SOURCE_GROUP(${LIBRARY_NAME}_SOURCES)
......
......@@ -13,9 +13,8 @@ function(add_coal_test test_name source)
Boost::filesystem
${utility_target}
)
IF(NOT WIN32)
target_compile_options(${target_name} PRIVATE "-Wno-c99-extensions")
ENDIF()
cxx_flags_by_compiler_frontend(GNU "-Wno-c99-extensions" OUTPUT PRIVATE_OPTIONS)
target_compile_options(${target_name} PRIVATE ${PRIVATE_OPTIONS})
if(COAL_HAS_QHULL)
target_compile_options(${target_name} PRIVATE -DCOAL_HAS_QHULL)
endif()
......
......@@ -49,8 +49,6 @@
#endif
#ifdef _WIN32
#define NOMINMAX // required to avoid compilation errors with Visual Studio
// 2010
#include <windows.h>
#else
#include <sys/time.h>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment