Link all dependencies statically
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Deukhoofd 2021-08-29 16:10:14 +02:00
parent 64b92b009c
commit 56055641c1
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 8 additions and 2 deletions

View File

@ -2,9 +2,10 @@ cmake_minimum_required(VERSION 3.18)
project(PokemonScriptTester) project(PokemonScriptTester)
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
set(BUILD_SHARED_LIBS OFF)
option(WINDOWS "Whether the build target is Windows or not." OFF) option(WINDOWS "Whether the build target is Windows or not." OFF)
set(STATICC TRUE) set(SHARED OFF)
include(CMakeLists.txt.in) include(CMakeLists.txt.in)
include_pkmnlib() include_pkmnlib()
@ -13,12 +14,17 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-fconcepts) add_compile_options(-fconcepts)
endif () endif ()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_link_options(-fuse-ld=lld)
endif ()
file(GLOB_RECURSE SRC_FILES src/*.cpp src/*.hpp) file(GLOB_RECURSE SRC_FILES src/*.cpp src/*.hpp)
add_executable(PokemonScriptTester ${SRC_FILES}) add_executable(PokemonScriptTester ${SRC_FILES})
target_precompile_headers(PokemonScriptTester PUBLIC src/Precompiled.hxx) target_precompile_headers(PokemonScriptTester PUBLIC src/Precompiled.hxx)
add_definitions(-DLEVEL_U8) add_definitions(-DLEVEL_U8)
SET(_LINKS Arbutils CreatureLib pkmnLib -lpthread) SET(_LINKS -static pkmnLib)
target_link_libraries(PokemonScriptTester PUBLIC ${_LINKS}) target_link_libraries(PokemonScriptTester PUBLIC ${_LINKS})
target_compile_options(PokemonScriptTester PRIVATE -Wall -Wextra -Werror) target_compile_options(PokemonScriptTester PRIVATE -Wall -Wextra -Werror)