Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
70ee47dd
Commit
70ee47dd
authored
Feb 18, 2016
by
Ben Pritchard
Browse files
Add Intel to cmake file. Supress Intel inline/noinline warning
parent
0b6cff3d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
CMakeLists.txt
CMakeLists.txt
+8
-1
include/pybind11/pybind11.h
include/pybind11/pybind11.h
+2
-0
No files found.
CMakeLists.txt
View file @
70ee47dd
...
@@ -38,7 +38,7 @@ endif()
...
@@ -38,7 +38,7 @@ endif()
string
(
REPLACE
"+"
""
PYTHONLIBS_VERSION_STRING
"+
${
PYTHONLIBS_VERSION_STRING
}
"
)
string
(
REPLACE
"+"
""
PYTHONLIBS_VERSION_STRING
"+
${
PYTHONLIBS_VERSION_STRING
}
"
)
find_package
(
PythonInterp
${
PYTHONLIBS_VERSION_STRING
}
EXACT REQUIRED
)
find_package
(
PythonInterp
${
PYTHONLIBS_VERSION_STRING
}
EXACT REQUIRED
)
if
(
CMAKE_CXX_COMPILER_ID MATCHES
"Clang"
OR CMAKE_CXX_COMPILER_ID MATCHES
"GNU"
)
if
(
CMAKE_CXX_COMPILER_ID MATCHES
"Clang"
OR CMAKE_CXX_COMPILER_ID MATCHES
"GNU"
OR CMAKE_CXX_COMPILER_ID MATCHES
"Intel"
)
CHECK_CXX_COMPILER_FLAG
(
"-std=c++14"
HAS_CPP14_FLAG
)
CHECK_CXX_COMPILER_FLAG
(
"-std=c++14"
HAS_CPP14_FLAG
)
CHECK_CXX_COMPILER_FLAG
(
"-std=c++11"
HAS_CPP11_FLAG
)
CHECK_CXX_COMPILER_FLAG
(
"-std=c++11"
HAS_CPP11_FLAG
)
...
@@ -57,10 +57,17 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU"
...
@@ -57,10 +57,17 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU"
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-fvisibility=hidden"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-fvisibility=hidden"
)
# Check for Link Time Optimization support
# Check for Link Time Optimization support
# (GCC/Clang)
CHECK_CXX_COMPILER_FLAG
(
"-flto"
HAS_LTO_FLAG
)
CHECK_CXX_COMPILER_FLAG
(
"-flto"
HAS_LTO_FLAG
)
if
(
HAS_LTO_FLAG
)
if
(
HAS_LTO_FLAG
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-flto"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-flto"
)
endif
()
endif
()
# Intel equivalent to LTO is called IPO
CHECK_CXX_COMPILER_FLAG
(
"-ipo"
HAS_IPO_FLAG
)
if
(
HAS_IPO_FLAG
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-ipo"
)
endif
()
endif
()
endif
()
endif
()
endif
()
...
...
include/pybind11/pybind11.h
View file @
70ee47dd
...
@@ -17,6 +17,8 @@
...
@@ -17,6 +17,8 @@
# pragma warning(disable: 4996) // warning C4996: The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name
# pragma warning(disable: 4996) // warning C4996: The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name
# pragma warning(disable: 4100) // warning C4100: Unreferenced formal parameter
# pragma warning(disable: 4100) // warning C4100: Unreferenced formal parameter
# pragma warning(disable: 4512) // warning C4512: Assignment operator was implicitly defined as deleted
# pragma warning(disable: 4512) // warning C4512: Assignment operator was implicitly defined as deleted
#elif defined(__ICC) || defined(__INTEL_COMPILER)
# pragma warning(disable:2196) // warning #2196: routine is both "inline" and "noinline"
#elif defined(__GNUG__) and !defined(__clang__)
#elif defined(__GNUG__) and !defined(__clang__)
# pragma GCC diagnostic push
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
# pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
...
...
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