Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
a55800f5
Commit
a55800f5
authored
Feb 28, 2018
by
LS Cook
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'cyphers/dochow' of github.com:NervanaSystems/private-ngraph-cpp into cyphers/dochow
parents
bbe1c66c
ff467c65
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
5 deletions
+44
-5
CMakeLists.txt
CMakeLists.txt
+7
-5
var_functions.cmake
cmake/Modules/var_functions.cmake
+37
-0
No files found.
CMakeLists.txt
View file @
a55800f5
...
...
@@ -60,6 +60,8 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# set directory where the custom finders live
set
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
"
${
CMAKE_SOURCE_DIR
}
/cmake/Modules/"
)
include
(
var_functions
)
#-----------------------------------------------------------------------------------------------
# Installation logic...
#-----------------------------------------------------------------------------------------------
...
...
@@ -97,11 +99,11 @@ endif()
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-std=c++11"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-O3"
)
if
(
DEFINED ENV{NGRAPH_WARNINGS_AS_ERRORS}
)
if
(
$ENV{NGRAPH_WARNINGS_AS_ERRORS}
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Werror
"
)
message
(
STATUS
"Warnings as errors
"
)
endif
(
)
ngraph_var
(
NGRAPH_WARNINGS_AS_ERRORS DEFAULT
"OFF"
)
if
(
"
${
NGRAPH_WARNINGS_AS_ERRORS
}
"
MATCHES
"^(ON|TRUE)$
"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Werror
"
)
message
(
STATUS
"Warnings as errors"
)
endif
()
SET
(
CMAKE_CXX_FLAGS_RELWITHDEBINFO
"-O3 -g"
)
SET
(
CMAKE_CXX_FLAGS_RELEASE
"-O3"
)
...
...
cmake/Modules/var_functions.cmake
0 → 100644
View file @
a55800f5
# ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ******************************************************************************
# function check existence of cmake and environment variable and read their value
# If the variable is not defined then the supplied default value used
# example:
# ngraph_var(NGRAPH_VARIABLE_NAME DEFAULT "OFF")
# checks if variable NGRAPH_VARIABLE_NAME was passed in via the cmake command line
# if found then passed in value is used
# else checks for the existence of the environment variable NGRAPH_VARIABLE_NAME
# if found it's value is used
# if none of the above then the default value is used
function
(
NGRAPH_VAR
)
set
(
options
)
set
(
oneValueArgs DEFAULT
)
set
(
multiValueArgs
)
cmake_parse_arguments
(
NGRAPH_VAR
"
${
options
}
"
"
${
oneValueArgs
}
"
"
${
multiValueArgs
}
"
${
ARGN
}
)
if
(
NOT DEFINED
${
NGRAPH_VAR_UNPARSED_ARGUMENTS
}
)
set
(
${
NGRAPH_VAR_UNPARSED_ARGUMENTS
}
${
NGRAPH_VAR_DEFAULT
}
PARENT_SCOPE
)
if
(
DEFINED ENV{
${
NGRAPH_VAR_UNPARSED_ARGUMENTS
}
}
)
set
(
${
NGRAPH_VAR_UNPARSED_ARGUMENTS
}
$ENV{
${
NGRAPH_VAR_UNPARSED_ARGUMENTS
}
} PARENT_SCOPE
)
endif
()
endif
()
endfunction
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment