mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
Fixing cmake developer warning (#972)
Here is the warning currently being produced: CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.19/Modules/GNUInstallDirs.cmake:223 (message): Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. Please enable at least one language before including GNUInstallDirs. Call Stack (most recent call first): cmake/guidelineSupportLibrary.cmake:20 (include) CMakeLists.txt:4 (include) This warning is for project developers. Use -Wno-dev to suppress it. I noted how I fixed the error. This is caused by GNUInstallDirs automatically executing code just by including it. I also added -Werror=dev to the CI to ensure this never happens again. Co-authored-by: Juan Ramos <juanr0911@gmail.com>
This commit is contained in:
parent
d9fa328f89
commit
84aeb59f26
2
.github/workflows/android.yml
vendored
2
.github/workflows/android.yml
vendored
@ -29,7 +29,7 @@ jobs:
|
|||||||
echo "Emulator starting"
|
echo "Emulator starting"
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
run: cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=16 -DANDROID_ABI=x86_64 -DCMAKE_BUILD_TYPE=Debug ..
|
run: cmake -Werror=dev -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=16 -DANDROID_ABI=x86_64 -DCMAKE_BUILD_TYPE=Debug ..
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cmake --build . --parallel
|
run: cmake --build . --parallel
|
||||||
|
1
.github/workflows/ios.yml
vendored
1
.github/workflows/ios.yml
vendored
@ -21,6 +21,7 @@ jobs:
|
|||||||
- name: Configure
|
- name: Configure
|
||||||
run: |
|
run: |
|
||||||
cmake \
|
cmake \
|
||||||
|
-Werror=dev \
|
||||||
-GXcode \
|
-GXcode \
|
||||||
-DCMAKE_SYSTEM_NAME=iOS \
|
-DCMAKE_SYSTEM_NAME=iOS \
|
||||||
"-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" \
|
"-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" \
|
||||||
|
@ -8,6 +8,9 @@ project(GSL
|
|||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Must include after the project call due to GNUInstallDirs requiring a language be enabled (IE. CXX)
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
# Creates a library GSL which is an interface (header files only)
|
# Creates a library GSL which is an interface (header files only)
|
||||||
add_library(GSL INTERFACE)
|
add_library(GSL INTERFACE)
|
||||||
|
|
||||||
|
@ -16,9 +16,6 @@ endif()
|
|||||||
# Necessary for 'write_basic_package_version_file'
|
# Necessary for 'write_basic_package_version_file'
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
|
|
||||||
# Use GNUInstallDirs to provide the right locations on all platforms
|
|
||||||
include(GNUInstallDirs)
|
|
||||||
|
|
||||||
function(gsl_set_default_cxx_standard min_cxx_standard)
|
function(gsl_set_default_cxx_standard min_cxx_standard)
|
||||||
set(GSL_CXX_STANDARD "${min_cxx_standard}" CACHE STRING "Use c++ standard")
|
set(GSL_CXX_STANDARD "${min_cxx_standard}" CACHE STRING "Use c++ standard")
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ steps:
|
|||||||
name: Configure
|
name: Configure
|
||||||
inputs:
|
inputs:
|
||||||
workingDirectory: build
|
workingDirectory: build
|
||||||
cmakeArgs: '-DCMAKE_CXX_STANDARD=$(GSL_CXX_STANDARD) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) .. '
|
cmakeArgs: '-DCMAKE_CXX_STANDARD=$(GSL_CXX_STANDARD) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -Werror=dev .. '
|
||||||
|
|
||||||
- task: CMake@1
|
- task: CMake@1
|
||||||
name: Build
|
name: Build
|
||||||
|
Loading…
Reference in New Issue
Block a user