premake/premake-core

Make with Clang fails to find `ar` on Windows

Aperta

#1742 aperta il 1 nov 2021

 (27 commenti) (0 reazioni) (0 assegnatari)C (651 fork)auto 404
good first issuesupport-request

Metriche repository

Star
 (3621 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

I am working on a GnuMake based Build-System for a GameEngine. I got clang installed and set toolset("clang"). At the Moment I am able to compile GLFW, but it dosn't link. Is there a way to set the toolset for the linker?

This is the premake5.lua I use:

workspace ("VoidSpaceProject")
	systemversion ("latest")
	architecture ("x86", "x64")
	configurations
	{
		"debugwin32", "debugwin64",
		"devwin32", "devwin64",
		"releasewin32", "releasewin64"
	}
	toolset ("clang")
	
	cppdialect ("C++17")

	location (".")

	--===========================================================
	--	Path Variables
	--===========================================================

	pathGLFW = (".ext/GLFW/")
	pathEngine = ("Engine/")
	pathTestbed = ("Testbed/")

	pathObj = (".bin/.int/%{prj.name}/%{cfg.buildcfg}/")
	pathOut = (".bin/%{prj.name}/%{cfg.buildcfg}/")

	--===========================================================
	--	GLFW Project
	--===========================================================
	project ("GLFW")
		language ("C")
		kind ("StaticLib")

		location (".ext/GLFW")

		targetdir (pathOut)
		objdir (pathObj)

		--===========================================================
		--	CrossPlatform Settings
		staticruntime "On"
		includedirs
		{
			"%{prj.location}/src/"
		}
		files
		{
			"%{prj.location}/include/GLFW/glfw3.h",
			"%{prj.location}/include/GLFW/glfw3native.h",
			"%{prj.location}/src/glfw_config.h",
			"%{prj.location}/src/context.c",
			"%{prj.location}/src/init.c",
			"%{prj.location}/src/input.c",
			"%{prj.location}/src/monitor.c",
			"%{prj.location}/src/vulkan.c",
			"%{prj.location}/src/window.c"
		}
		-- filter {}
		--	CrossPlatform Settings
		--===========================================================

		--===========================================================
		--	Win32 Settings
		filter ("configurations:*win32")
			system ("windows")
			architecture ("x86")
			files
			{
				"%{prj.location}/src/win32_init.c",
				"%{prj.location}/src/win32_joystick.c",
				"%{prj.location}/src/win32_monitor.c",
				"%{prj.location}/src/win32_time.c",
				"%{prj.location}/src/win32_thread.c",
				"%{prj.location}/src/win32_window.c",
				"%{prj.location}/src/wgl_context.c",
				"%{prj.location}/src/egl_context.c",
				"%{prj.location}/src/osmesa_context.c"
			}
			defines
			{
				("_GLFW_WIN32"),
				("_CRT_SECURE_NO_WARNINGS")
			}
		filter {}
		--	Win32 Settings
		--===========================================================

		--===========================================================
		--	Win64 Settings
		filter ("configurations:*win64")
			system ("windows")
			architecture ("x64")
			files
			{
				"%{prj.location}/src/win32_init.c",
				"%{prj.location}/src/win32_joystick.c",
				"%{prj.location}/src/win32_monitor.c",
				"%{prj.location}/src/win32_time.c",
				"%{prj.location}/src/win32_thread.c",
				"%{prj.location}/src/win32_window.c",
				"%{prj.location}/src/wgl_context.c",
				"%{prj.location}/src/egl_context.c",
				"%{prj.location}/src/osmesa_context.c"
			}
			defines
			{
				"_GLFW_WIN32",
				"_CRT_SECURE_NO_WARNINGS"
			}
		filter {}
		--	Win64 Settings
		--===========================================================

		--===========================================================
		--	Configurations
		filter ("configurations:DebugWin32")
			defines {"VSE_DEBUG"}
			runtime ("Debug")
			symbols ("On")

		filter ("configurations:DebugWin64")
			defines {"VSE_DEBUG"}
			runtime ("Debug")
			symbols ("On")
		
		filter ("configurations:DevWin32")
			defines {"VSE_DEV"}
			runtime ("Release")
			optimize "Speed"

		filter ("configurations:DevWin64")
			defines {"VSE_DEV"}
			runtime ("Release")
			optimize "Speed"

		filter ("configurations:ReleaseWin32")
			defines {"VSE_RELEASE"}
			runtime ("Release")
			optimize "Speed"
		
		filter ("configurations:ReleaseWin64")
			defines {"VSE_RELEASE"}
			runtime ("Release")
			optimize "Speed"
		filter {}
		--	Configurations
		--===========================================================

Guida contributor