Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pxntus
Copy link

@pxntus pxntus commented Jun 26, 2019

Windows build fixes:

  • GCC compile flags only for Linux/GCC
  • Windows related install fix
  • No linking against librt since not needed (and unavailable for Windows)
  • Including algorithm header to get min (for integers)

CMake modernization:

  • Enabling C++11 according to best practices
  • Target based approach for include directories of library

pxntus added 3 commits June 26, 2019 10:15
- Setting C++11 and other compiler options without directly using compiler flags.
- Using a target based approach (instead of directory based) for setting include directories.
CMakeLists.txt Outdated
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-long-long")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-align")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-conversion")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about CLANG?

install( TARGETS sgp4s LIBRARY DESTINATION lib )
if(WIN32)
install(TARGETS sgp4s
RUNTIME DESTINATION lib)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why the library requires the runtime location specified?

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-long-long")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-align")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-conversion")
if(CMAKE_COMPILER_IS_GNUCC)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again is this compatible with clang?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I forgot about this. I will try to motivate the change request in the following days. (Just to mention: I actually use my branch of your code in a ground segment tool for satellites that will launch during 2020.)

@SpaceIm
Copy link

SpaceIm commented Feb 24, 2020

@pxntus @dnwrnr You could also use CMake feature WINDOWS_EXPORT_ALL_SYMBOLS. Indeed currently a shared libsgp4 fails to link into an executable or shared lib because symbols are not exported on windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants