File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,10 @@ add_library(ada ada.cpp)
11
11
target_compile_features (ada PUBLIC cxx_std_20 )
12
12
target_include_directories (ada PRIVATE $< BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} > )
13
13
target_include_directories (ada PUBLIC "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR} /include>" )
14
-
14
+ if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE )
15
+ # We default to ON for all targets, so that we can use the library in shared libraries.
16
+ set_target_properties (ada PROPERTIES POSITION_INDEPENDENT_CODE ON )
17
+ endif (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE )
15
18
if (MSVC )
16
19
if ("${MSVC_TOOLSET_VERSION} " STREQUAL "140" )
17
20
target_compile_options (ada INTERFACE /W0 /sdl )
@@ -20,9 +23,6 @@ if(MSVC)
20
23
target_compile_options (ada PRIVATE /WX /W3 /sdl /w34714 ) # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4714?view=vs-2019
21
24
endif ()
22
25
else (MSVC )
23
- if (NOT WIN32 )
24
- target_compile_options (ada INTERFACE -fPIC )
25
- endif ()
26
26
message (STATUS "Assuming GCC-like compiler." )
27
27
target_compile_options (ada PRIVATE -Wall -Wextra -Weffc++ )
28
28
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
You can’t perform that action at this time.
0 commit comments