From 56055641c1c724d4e63904c5d436c92c356af60e Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sun, 29 Aug 2021 16:10:14 +0200 Subject: [PATCH] Link all dependencies statically --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aa08094..89747ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,9 +2,10 @@ cmake_minimum_required(VERSION 3.18) project(PokemonScriptTester) set(CMAKE_CXX_STANDARD 20) +set(BUILD_SHARED_LIBS OFF) option(WINDOWS "Whether the build target is Windows or not." OFF) -set(STATICC TRUE) +set(SHARED OFF) include(CMakeLists.txt.in) include_pkmnlib() @@ -13,12 +14,17 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") add_compile_options(-fconcepts) endif () +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + add_link_options(-fuse-ld=lld) +endif () + + file(GLOB_RECURSE SRC_FILES src/*.cpp src/*.hpp) add_executable(PokemonScriptTester ${SRC_FILES}) target_precompile_headers(PokemonScriptTester PUBLIC src/Precompiled.hxx) add_definitions(-DLEVEL_U8) -SET(_LINKS Arbutils CreatureLib pkmnLib -lpthread) +SET(_LINKS -static pkmnLib) target_link_libraries(PokemonScriptTester PUBLIC ${_LINKS}) target_compile_options(PokemonScriptTester PRIVATE -Wall -Wextra -Werror)