Skip to content

Commit 209ecf3

Browse files
committed
correct policy setup, propagate to all 3rdparty projects; silents some warnings and fixes an issue with bz2 error only on first configure run
1 parent bba9dab commit 209ecf3

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

3rdparty/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
include(../cmake/common.cmake)
66

7+
project(Nabla-3rdparty LANGUAGES CXX C)
8+
enable_language(C CXX ASM ASM_NASM)
9+
710
option(NBL_FORCE_RELEASE_3RDPARTY "Force map 3rdaprty's configuration regardless Nabla configuration to Release" OFF)
811
option(NBL_FORCE_RELWITHDEBINFO_3RDPARTY "Force map 3rdaprty's configuration regardless Nabla configuration to RelWithDebInfo" OFF)
912

CMakeLists.txt

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
# Copyright (C) 2018-2020 - DevSH Graphics Programming Sp. z O.O.
22
# This file is part of the "Nabla Engine".
33
# For conditions of distribution and use, see copyright notice in nabla.h.in or nabla.h
4-
54
cmake_minimum_required(VERSION 3.31)
6-
# TODO: Yas - once we deploy 4.x we will fire `cmake_policy` instead of manually picking policies
5+
6+
# TODO: Yas - once we deploy 4.x we will fire `cmake_policy(VERSION <min>[...<max>])` instead of manually picking policies
77
# https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html#policy-version
88
# also we should update deps which throw warnings about < 3.10 compatibility
9-
cmake_policy(SET CMP0003 NEW) # https://cmake.org/cmake/help/latest/policy/CMP0077.html#cmp0077
10-
cmake_policy(SET CMP0077 NEW) # https://cmake.org/cmake/help/latest/policy/CMP0077.html#cmp0077
11-
cmake_policy(SET CMP0112 NEW) # https://cmake.org/cmake/help/latest/policy/CMP0112.html#cmp0112
12-
cmake_policy(SET CMP0141 NEW) # https://cmake.org/cmake/help/latest/policy/CMP0141.html#policy:CMP0141
13-
cmake_policy(SET CMP0118 NEW) # https://cmake.org/cmake/help/latest/policy/CMP0118.html#policy:CMP0118
9+
10+
macro(NBL_POLICY P S)
11+
if(POLICY ${P})
12+
cmake_policy(SET ${P} ${S})
13+
set(CMAKE_POLICY_DEFAULT_${P} ${S})
14+
endif()
15+
endmacro()
16+
17+
NBL_POLICY(CMP0003 NEW) # https://cmake.org/cmake/help/latest/policy/CMP0003.html#cmp0003
18+
NBL_POLICY(CMP0077 NEW) # https://cmake.org/cmake/help/latest/policy/CMP0077.html#cmp0077
19+
NBL_POLICY(CMP0112 NEW) # https://cmake.org/cmake/help/latest/policy/CMP0112.html#cmp0112
20+
NBL_POLICY(CMP0141 NEW) # https://cmake.org/cmake/help/latest/policy/CMP0141.html#policy:CMP0141
21+
NBL_POLICY(CMP0118 NEW) # https://cmake.org/cmake/help/latest/policy/CMP0118.html#policy:CMP0118
1422

1523
set(NBL_BUILD_ANDROID OFF)
1624

0 commit comments

Comments
 (0)