Skip to content

Commit

Permalink
Build static
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitMorel committed Jul 23, 2022
1 parent 49a048a commit 40bf53e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra")
add_subdirectory(core)

macro(add_program program_name program_sources)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_EXE_LINKER_FLAGS "-static")
if(LINUX)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_EXE_LINKER_FLAGS "-static")
endif()
add_executable(${program_name} ${program_sources})
target_link_libraries(${program_name}
asteroid-core
Expand Down

0 comments on commit 40bf53e

Please sign in to comment.