Commit d4dd5606 authored by Michael Tesch's avatar Michael Tesch
Browse files

Merge branch 'fx-build-warnings' into 'master'

Fx build warnings

See merge request !36
parents 6cbd7486 095250ca
Loading
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -3,9 +3,8 @@ clone_folder: c:\projects\cppduals
clone_depth: 3

image:
#- Visual Studio 2013
#- Visual Studio 2015
- Visual Studio 2017
#- Visual Studio 2022

configuration:
- Release
@@ -14,12 +13,10 @@ configuration:
# Do not build feature branch with open Pull Requests
skip_branch_with_pr: true

# skip unsupported combinations
init:
- echo %APPVEYOR_BUILD_WORKER_IMAGE%
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2013" ( set generator="Visual Studio 12 2013" )
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" ( set generator="Visual Studio 14 2015" )
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" ( set generator="Visual Studio 15 2017" )
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2022" ( set generator="Visual Studio 17 2022" )
- echo %generator%

before_build:
+6 −0
Original line number Diff line number Diff line
@@ -8,3 +8,9 @@ Thumbs.db

build*
clang*
# Allow .vscode directory but ignore some files
.vscode/ipch
.vscode/browse.vc.db*
.cache
Build-*/
compile_commands.json
+10 −18
Original line number Diff line number Diff line
#image: ubuntu:19.04
# You can override the included template(s) by including variable overrides
# See https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#priority-of-environment-variables
image: fedora:30
image: fedora:41

variables:
  GIT_DEPTH: 3
@@ -17,41 +12,38 @@ stages:
- upload
- release

before_script:
#- apt-get update --yes
#- apt-get install --yes cmake g++ git doxygen lcov graphviz

build:
  stage: build
#  variables:
#    CC: clang
#    CXX: clang++  script:
  script:
  - dnf install -y gcc-c++ make cmake git doxygen lcov graphviz
  - echo $CXX
  - gcc -march=native -dM -E - </dev/null | grep -i sse
  - cmake -Bbuild -H. -DCPPDUALS_TESTING=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
  - cmake --build build
#  - cmake -Bbuild-latest -H. -DCPPDUALS_TESTING=ON -DCPPDUALS_EIGEN_LATEST=ON
#  - cmake --build build-latest
  artifacts:
    expire_in: 1 week
    paths:
    - build/
#    - build-latest
  only:
  - merge_requests
  - master

test:
  stage: test
  script:
  - dnf install -y gcc-c++ make cmake git doxygen lcov graphviz
  - cmake --build build --target test
#  - cmake --build build-latest --target test
  dependencies:
  - build
  only:
  - merge_requests
  - master

cover:
  stage: cover
  script:
  - dnf install -y gcc-c++ make cmake git doxygen lcov graphviz
  - cmake -Bbuild-cov -H. -DCODE_COVERAGE=ON -DCPPDUALS_TESTING=ON
  - cmake -Bbuild-cov -H. -DCPPDUALS_TESTING=ON -DCODE_COVERAGE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
  - cmake --build build-cov --target cov
  - cmake --build build-cov --target cov-html
  coverage: "/Total:|\\w*\\d+\\.\\d+/"
+18 −10
Original line number Diff line number Diff line
#
# CMake for cppduals
#
cmake_minimum_required (VERSION 3.12)
cmake_minimum_required (VERSION 3.14)
project (cppduals
  VERSION 0.5.4
  VERSION 0.6.0
  LANGUAGES C CXX
  )
include (GNUInstallDirs)

if (NOT CMAKE_CXX_STANDARD)
  set (CMAKE_CXX_STANDARD 14 CACHE STRING "Which C++ standard to test against.")
  set (CMAKE_CXX_STANDARD 17 CACHE STRING "Which C++ standard to test against.")
endif()
message (STATUS "CXX_STANDARD: ${CMAKE_CXX_STANDARD}")
set (CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -41,7 +41,8 @@ if (CPPDUALS_STANDALONE AND
  message (STATUS "No install prefix specified; using '${CMAKE_INSTALL_PREFIX}'")
endif ()

set_property (CACHE CMAKE_CXX_STANDARD PROPERTY STRINGS 11 14 17 20)
#set_property (CACHE CMAKE_CXX_STANDARD PROPERTY STRINGS 11 14 17 20)
set_property (CACHE CMAKE_CXX_STANDARD PROPERTY STRINGS 20)

option (CPPDUALS_TESTING "Enable testing" OFF)
option (CPPDUALS_BENCHMARK "Enable benchmarking" OFF)
@@ -94,7 +95,7 @@ add_library (cppduals::duals ALIAS cppduals_duals)
#
if (CPPDUALS_TESTING)

  cmake_minimum_required (VERSION 3.10) # need gtest_discover_tests
  cmake_minimum_required (VERSION 3.14) # need gtest_discover_tests
  file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/thirdparty")

  # generator name
@@ -149,16 +150,23 @@ endif ()
add_library (cppduals_coverage_config INTERFACE)
option (CODE_COVERAGE "Enable coverage reporting" OFF)
if (CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
  message(STATUS "Enabling coverage reporting")
  # Add required flags (GCC & LLVM/Clang)
  target_compile_options (cppduals_coverage_config INTERFACE
    -O0        # no optimization
    -g         # generate debug info
    --coverage # sets all required flags
    -fprofile-arcs 
    -ftest-coverage
  )
  if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
    target_link_options (cppduals_coverage_config INTERFACE 
      --coverage
    )
  if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
    target_link_options (cppduals_coverage_config INTERFACE --coverage)
  else()
    target_link_libraries (cppduals_coverage_config INTERFACE --coverage)
    target_link_options (cppduals_coverage_config INTERFACE 
      --coverage
    )
  endif()
endif ()

Makefile

0 → 100644
+138 −0
Original line number Diff line number Diff line
SHELL=bash
TARGET=cppduals
CMAKE_OPTIONS=-DCPPDUALS_TESTING=ON -DCPPDUALS_BENCHMARK=ON -DCPPDUALS_EIGEN_LATEST=OFF
CMAKE=cmake
DEFAULT_TARGET=package
GCC?=gcc-14
GXX?=g++-14
CLANG?=clang
CLANGXX?=clang++
CMAKE_BUILD_PARALLEL_LEVEL?=1
export CMAKE_BUILD_PARALLEL_LEVEL

all:
	[ `uname` != Darwin ] || $(MAKE) clang clangr cc ccr osx osxr ios iosr
	[ `uname` != Linux ]  || $(MAKE) cc ccr
	[ ! -d ~/.android ] || $(MAKE) android
	[ ! -f ~/.emscripten ] || $(MAKE) em

help:
	@echo "Make targets for :" $(TARGET)
	@echo " clang   	    - build debug package using clang compiler"
	@echo " clangr       - build release package using clang compiler"
	@echo " test         - "
	@echo " test-clang   - "
	@echo " osx          - build debug package using XCode command-line"
	@echo " osxr         - build release package using XCode command-line"
	@echo " cc           - build debug package using cc/gcc compiler"
	@echo " ccr          - build release package using cc/gcc compiler"
	@echo " and          - build android using gradle in ./Android"
	@echo " em-sdl2      - build debug package using cc/gcc compiler"
	@echo " em           ^ alias"
	@echo " em-sdl2r     - build release package using cc/gcc compiler"
	@echo " emr          ^ alias"
	@echo " "
	@echo " distclean    - remove ALL build directories from the above targets"
#	@echo " tags         - "


Build-clang/Makefile Build-clang/compile_commands.json:
	CC=$(CLANG) CXX=$(CLANGXX) $(CMAKE) . -BBuild-clang \
		-G'Unix Makefiles' \
		$(CMAKE_OPTIONS) \
		-DCMAKE_BUILD_TYPE=Debug \
		-DCMAKE_EXPORT_COMPILE_COMMANDS=1

Build-clangr/Makefile:
	CC=$(CLANG) CXX=$(CLANGXX) $(CMAKE) . -BBuild-clangr \
		-G'Unix Makefiles' \
		$(CMAKE_OPTIONS) \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo
		-DCMAKE_EXPORT_COMPILE_COMMANDS=1

Build-cc/Makefile:
	CC=$(GCC) CXX=$(GXX) $(CMAKE) . -BBuild-cc \
		-G'Unix Makefiles' \
		$(CMAKE_OPTIONS) \
		-DCMAKE_BUILD_TYPE=Debug \
		-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
		-DCPPDUALS_TESTING=ON -DCODE_COVERAGE=ON

Build-ccr/Makefile:
	CC=$(GCC) CXX=$(GXX) $(CMAKE) . -BBuild-ccr \
		-G'Unix Makefiles' \
		$(CMAKE_OPTIONS) \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_EXPORT_COMPILE_COMMANDS=1

compile_commands.json: Build-clang/compile_commands.json
	[ -L compile_commands.json ] || ln -s Build-clang/compile_commands.json ./

clang: Build-clang/Makefile compile_commands.json
	$(CMAKE) --build Build-clang  --target $(DEFAULT_TARGET)

clangr: Build-clangr/Makefile
	$(CMAKE) --build Build-clangr --target $(DEFAULT_TARGET)

cc: Build-cc/Makefile
	$(CMAKE) --build Build-cc  --target $(DEFAULT_TARGET)

ccr: Build-ccr/Makefile
	$(CMAKE) --build Build-ccr --target $(DEFAULT_TARGET)

test: ccr clangr
	CTEST_OUTPUT_ON_FAILURE=y $(CMAKE) --build Build-ccr --target test
	CTEST_OUTPUT_ON_FAILURE=y $(CMAKE) --build Build-clangr --target test

cov: cc
	CMAKE_BUILD_PARALLEL_LEVEL=8 $(CMAKE) --build Build-cc --target test
	$(CMAKE) --build Build-cc --target cov-html

Build-osx/cppduals.xcodeproj:
	$(CMAKE) . -BBuild-osx -GXcode $(CMAKE_OPTIONS)

osx: Build-osx/cppduals.xcodeproj
	$(CMAKE) --build Build-osx --config Debug --target $(DEFAULT_TARGET)

osxr: Build-osx/cppduals.xcodeproj
	$(CMAKE) --build Build-osx --config Release --target $(DEFAULT_TARGET)

Frameworks.iOS/SDL2.framework/SDL2:
	echo "Running ./scripts/Build_SDL2_framework.sh ios"
	./scripts/Build_SDL2_framework.sh ios

and:
	cd Android && ./gradlew build

Build-emsc/Makefile:
	source ${HOME}/local/emsdk/emsdk_env.sh ; \
	emcmake $(CMAKE) . -BBuild-emsc -DBUILD_SDL2=OFF -DBUILD_FREETYPE=OFF \
		$(CMAKE_OPTIONS)
#		-DCMAKE_TOOLCHAIN_FILE=$${EMSCRIPTEN}/cmake/Modules/Platform/Emscripten.cmake

Build-emscr/Makefile:
	source ${HOME}/local/emsdk/emsdk_env.sh ; \
	emcmake $(CMAKE) . -BBuild-emscr -DBUILD_SDL2=OFF \
		-DBUILD_FREETYPE=OFF $(CMAKE_OPTIONS) -DCMAKE_BUILD_TYPE=Release

em-sdl2: Build-emsc/Makefile
	cd Build-emsc && $(MAKE) cppduals

em-sdl2r: Build-emscr/Makefile
	cd Build-emscr && $(MAKE) cppduals

em-glfw: Build-emscgl/Makefile
	cd Build-emscgl && $(MAKE) cppduals

em: em-sdl2

emrun: em-sdl2
	source ${HOME}/local/emsdk/emsdk_env.sh && cd Build-emsc/ && emrun --serve_after_close cppduals.html

emr: em-sdl2r

distclean:
	rm -rf Build-* Android/app/.cxx/

tags:
	cd Build-ccr && $(MAKE) tags
Loading