Skip to content

Commit

Permalink
Merge pull request #48 from MattiaMontanari/46-error-in-build-invalid…
Browse files Browse the repository at this point in the history
…-numeric-armument-wunused

Remove Wunused from general compiler flags
  • Loading branch information
MattiaMontanari authored Dec 28, 2023
2 parents 0b41f4a + 6e5e732 commit 855c5c0
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/github-opengjk-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Run all demos
run-name: ${{ github.actor }} is running
on: [push]
jobs:
C:
C_GCC:
runs-on: ubuntu-latest
container: mmontanari/devenv:buildenv-fedora
steps:
Expand All @@ -13,6 +13,26 @@ jobs:
- run: cmake --build build
- run: cmake -E chdir build/examples/c/ ./example_lib_opengjk_ce

C_msvs:
runs-on: windows-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
- name: Install dependencies on windows
run: |
choco install ninja cmake
ninja --version
cmake --version
- run: cmake -E make_directory build
- run: cmake -E chdir build cmake ..
- run: cmake --build build
- run: cmake -E copy build/examples/c/Debug/example_lib_opengjk_ce.exe build/examples/c
- run: cmake -E chdir build/examples/c/ ./example_lib_opengjk_ce.exe

Cython:
runs-on: ubuntu-latest
container: mmontanari/devenv:buildenv-ubuntu
Expand All @@ -34,6 +54,7 @@ jobs:
- run: cmake -E chdir build cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MONO=ON -DSINGLE_PRECISION=ON ..
- run: cmake --build build --target opengjk_ce
- run: cmake -E chdir build make install
- run: cmake -E copy build/*opengjk_ce* examples/cs/
- run: cd examples/cs/ && mcs -out:main.exe main.cs && mono main.exe

GO:
Expand Down
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ project(lib_opengjk_ce

# Compiler flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
message(STATUS "Compiler in use: ${CMAKE_C_COMPILER_ID}")
set( CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall -Wunused")
set( CMAKE_C_FLAGS_RELEASE "-O3 -Werror")

if (CMAKE_C_COMPILER_ID STREQUAL "Clang")
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set( CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall")
set( CMAKE_C_FLAGS_RELEASE "-O3 -Werror")
elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set( CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall")
set( CMAKE_C_FLAGS_RELEASE "-O3 -Werror")
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wunused-macros -Wno-unused-command-line-argument")
elseif (CMAKE_C_COMPILER_ID STREQUAL "Intel")
elseif (CMAKE_C_COMPILER_ID STREQUAL "MSVC")
Expand Down Expand Up @@ -81,7 +83,9 @@ ${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}
)

IF (NOT WIN32)
target_link_libraries(obj_openGJK PRIVATE m)
ENDIF()

set_target_properties(obj_openGJK
PROPERTIES
Expand Down
5 changes: 5 additions & 0 deletions examples/c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ project(example_lib_opengjk_ce
)

add_executable(example_lib_opengjk_ce ${CMAKE_CURRENT_SOURCE_DIR}/main.c)

IF (WIN32)
target_link_libraries(example_lib_opengjk_ce obj_openGJK)
ELSE()
target_link_libraries(example_lib_opengjk_ce obj_openGJK m)
ENDIF()

# Copy input files for this example after build
add_custom_command(
Expand Down

0 comments on commit 855c5c0

Please sign in to comment.