Skip to content

Commit

Permalink
replace -fPIC with CMAKE_POSITION_INDEPENDENT_CODE flag. fix #132
Browse files Browse the repository at this point in the history
  • Loading branch information
Raffaello committed May 17, 2020
1 parent aa05c9d commit b33c25b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions sdl2-vga-terminal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ set(LIB_VER ${LIB_CONF}-version)
include(CMakePackageConfigHelpers)

add_library(${LIB_NAME} STATIC)
set_target_properties(${LIB_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
install(
TARGETS ${LIB_NAME}
EXPORT ${LIB_CONF}
Expand Down Expand Up @@ -165,7 +166,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "^MSVC")
)
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "^GNU")
target_compile_options(vga-terminal-static PRIVATE -Wall -Wextra -pedantic -fPIC
target_compile_options(vga-terminal-static PRIVATE -Wall -Wextra -pedantic #-fPIC
$<$<CONFIG:DEBUG>:
-O0;-D_GLIBCXX_DEBUG;-D_GLIBCXX_ASSERTIONS;-fexceptions;
-W; -Wshadow; -Wunused-variable;
Expand All @@ -192,7 +193,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang")
message(STATUS ${LINK_SUBSYS_WIN})
target_link_options(vga-terminal-static PUBLIC ${LINK_SUBSYS_WIN})
elseif(UNIX)
target_compile_options(vga-terminal-static PRIVATE -fPIC
target_compile_options(vga-terminal-static PRIVATE #-fPIC
$<$<CONFIG:DEBUG>: -g;>
$<$<CONFIG:RELEASE>:-O2;>
)
Expand Down
2 changes: 1 addition & 1 deletion sdl2-vga-terminal/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ macro(macro_example) # ${ARGN} link libraries
add_dependencies(${EXAMPLE_EXE} ${EXAMPLE_DEPS})
target_link_libraries(${EXAMPLE_EXE} ${EXAMPLE_LINKS})
if(${EXAMPLE_COPY_LIB})
message("===============EXAMPLE COPY LIB")
#message("===============EXAMPLE COPY LIB")
foreach(TF IN ITEMS ${EXAMPLE_DEPS})
#message("++++ TF= ${TF} ++++")
add_custom_command(
Expand Down

0 comments on commit b33c25b

Please sign in to comment.